Environment versions
Network:
Windows 2008 Server
>>>>If there is a postback between receiving this variable and retriving it, then it would be lost and you need to save it either in ViewState or in Session or in Cockie. Otherwise you can use a class variable declared on the class level.
>>>
>>>I ended up using Session variable. So far, in my testing, it works. I sent update to the customer for testing too.
>>
>>Hi,
>>Session would work but since it's just a simple string variable and is page specific using ViewState might be a better choice in this case.
>>Regards,
>>Viv
>
>Thank you, Viv.
>
>I have to look into how to accomplish the same as thing as with Session using ViewState (I have not done work in ASP.NET for a long time).
Pretty straightforward. To save:
ViewState["myVariable"] = myVariable;
To retrieve:
myVariable = ViewState["myVariable"];
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only