ASP.net: Make variable not to loss its value?

Hernan B

New member
Hi all,

I need your help to advise me on how I can make a variable not to loss its value even after postbacks or server-requests or anything

Example..
1.Start the asp.net page..
2.String variable is loaded as null (by default)
3.Assign a value to this variable ( String name = Hernan;)
4.If a go to another form.. when I am back the variable has
been set to null again :(

How can I make this variable to keep its value even after navigate, or postbacks, or request... or it gets refreshed..

Is that possible??? Is there trick for that ?

I don’t care …if I need ajax, or advance C# functions

Thanks A LOT for yur charism to help me
GOD Bless you a lot
 
1- session["Name"]= AssignedValue
getting value
varaiblenme=Session["Name"]

2- viewstate["name"]=AssignedValue

3-Add hidden field in aspx page and then assgined a value . later on you can use it.



hope it will help.
 
Back
Top