S
sourabh
Hi guys
Till now i thougt I understood ViewState but as I was trying write my
LoadViewState method i am sort of confused with what this ViewState is and
what is its use.
I have my LoadViewState method , i was curious to know wheres the state of
Various controls getting set on Post back. So I tried viewing the ViewState
but it doesnot show any controls and their values. I also had to implement
SaveViewstate to have my LoadViewState get called and again this was called
only when my page added some values to the ViewState in SaveViewState
method.
So the confussion is on postback how are the values for each control get set
back to the values which i have set earlier.
protected override void OnLoad( EventArgs e ){
// Put user code to initialize the page here
if(!IsPostBack)
{
TextBox1.Text = "wEQ";
}
}
Here I am checking for IsPostBack so I am not setting them again. I thought
this cam for ViewState but cant see these there.
Or am i completely wrong here and ViewState doesnot do all this?
Thanks
Sourabh
Till now i thougt I understood ViewState but as I was trying write my
LoadViewState method i am sort of confused with what this ViewState is and
what is its use.
I have my LoadViewState method , i was curious to know wheres the state of
Various controls getting set on Post back. So I tried viewing the ViewState
but it doesnot show any controls and their values. I also had to implement
SaveViewstate to have my LoadViewState get called and again this was called
only when my page added some values to the ViewState in SaveViewState
method.
So the confussion is on postback how are the values for each control get set
back to the values which i have set earlier.
protected override void OnLoad( EventArgs e ){
// Put user code to initialize the page here
if(!IsPostBack)
{
TextBox1.Text = "wEQ";
}
}
Here I am checking for IsPostBack so I am not setting them again. I thought
this cam for ViewState but cant see these there.
Or am i completely wrong here and ViewState doesnot do all this?
Thanks
Sourabh