1
Reply

Why we use view state and session state in asp.net2.0?Explain?

meera mishra

meera mishra

15y
5.1k
0
Reply

    View state and session state is used to retain the values of controls(Textbox,radiobutton,etc) in case of postback .....

    Session state example :

    1:Store values in session variable :

    session["String"]="value";

    2:Retrieve session variable value :

    string getName=session["String"]

    View state:

    Just make EnableViewState property of the control to true....