Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
QuestionDateTimePicker value format Pin
JMaior6-Nov-07 8:39
JMaior6-Nov-07 8:39 
QuestionInaccesible in CD of setup Pin
mehrdadc486-Nov-07 8:38
mehrdadc486-Nov-07 8:38 
AnswerRe: Inaccesible in CD of setup Pin
snorkie6-Nov-07 9:19
professionalsnorkie6-Nov-07 9:19 
Questionprevious and next buttons in DataList using C#.Net Pin
cwah6-Nov-07 8:16
cwah6-Nov-07 8:16 
QuestionClient/Server Disconnection Pin
jlgeris6-Nov-07 7:48
jlgeris6-Nov-07 7:48 
AnswerRe: Client/Server Disconnection Pin
Ennis Ray Lynch, Jr.6-Nov-07 8:09
Ennis Ray Lynch, Jr.6-Nov-07 8:09 
GeneralRe: Client/Server Disconnection Pin
jlgeris6-Nov-07 8:33
jlgeris6-Nov-07 8:33 
QuestionRe-use code Pin
simsen6-Nov-07 7:28
simsen6-Nov-07 7:28 
Hi,

I have the below code in a cs file (and it function perfect). But I know, I have to use that code in other files two. So I want to place the code in a Class file (cs file in App_Code dir).

I don't know what I shall do, so I can re-use the code in all the files I want. Can anyone show by example what to do - and how I use ind a file?

My code:

public String sortExpression<br />
    {<br />
        get<br />
        {<br />
            if (ViewState["sortExpression"] == null)<br />
            {<br />
                ViewState["sortExpression"] = Convert.ToString(grdEmployeeList.Columns[0].SortExpression);<br />
            }<br />
            return Convert.ToString(ViewState["sortExpression"]);<br />
        }<br />
        set<br />
        {<br />
            ViewState["sortExpression"] = value;<br />
        }<br />
    }


If I put the code directly into the Class file, I get an error, that ViewState is unknown.....

Kind regards,
simsen Smile | :)
AnswerRe: Re-use code Pin
half-life6-Nov-07 7:42
half-life6-Nov-07 7:42 
AnswerRe: Re-use code Pin
Kristian Sixhøj6-Nov-07 7:44
Kristian Sixhøj6-Nov-07 7:44 
GeneralRe: Re-use code Pin
simsen6-Nov-07 9:35
simsen6-Nov-07 9:35 
AnswerA few things Pin
Ennis Ray Lynch, Jr.6-Nov-07 8:14
Ennis Ray Lynch, Jr.6-Nov-07 8:14 
GeneralRe: A few things Pin
simsen6-Nov-07 9:38
simsen6-Nov-07 9:38 
GeneralRe: A few things Pin
Ennis Ray Lynch, Jr.6-Nov-07 9:42
Ennis Ray Lynch, Jr.6-Nov-07 9:42 
GeneralRe: A few things Pin
simsen6-Nov-07 10:00
simsen6-Nov-07 10:00 
GeneralRe: A few things Pin
Ennis Ray Lynch, Jr.6-Nov-07 10:54
Ennis Ray Lynch, Jr.6-Nov-07 10:54 
QuestionTreeView.SelectedNode.FullPath problem Pin
gerbenschmidt6-Nov-07 7:10
gerbenschmidt6-Nov-07 7:10 
AnswerRe: TreeView.SelectedNode.FullPath problem Pin
Alan N6-Nov-07 8:24
Alan N6-Nov-07 8:24 
GeneralRe: TreeView.SelectedNode.FullPath problem Pin
gerbenschmidt6-Nov-07 12:44
gerbenschmidt6-Nov-07 12:44 
QuestionQuestion about midi? Pin
Alphacore6-Nov-07 6:30
Alphacore6-Nov-07 6:30 
Questionspecify the number of users in XP Pro sp2 Pin
NvN>C6-Nov-07 6:08
NvN>C6-Nov-07 6:08 
AnswerRe: specify the number of users in XP Pro sp2 Pin
Guffa6-Nov-07 6:17
Guffa6-Nov-07 6:17 
QuestionAdd/Remove Windows Fonts Programmatically Pin
batanglasang6-Nov-07 5:15
batanglasang6-Nov-07 5:15 
AnswerRe: Add/Remove Windows Fonts Programmatically Pin
led mike6-Nov-07 5:30
led mike6-Nov-07 5:30 
GeneralRe: Add/Remove Windows Fonts Programmatically Pin
batanglasang6-Nov-07 6:37
batanglasang6-Nov-07 6:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.