C
Christian
Hi,
I have a Webform with 1 submit button and 1 label
code behind :
public class MainWebForm: System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label lblFName;
protected override void LoadViewState( object o )
{
lblFName.Text = (string)ViewState["FName"];
}
protected override object SaveViewState()
{
ViewState["FName"] = "Enter First Name Here";
return base.SaveViewState();
}
}
Upon loading the page the first time
- LoadViewState() is executed but ViewState["FName"] is empty --> normal
- SaveViewState() event is executed as well and saves a value in the
ViewState-object
Page is now displayed with an empty label : OK
Upon pressing the Submit button : page loads a second time
- LoadViewState() is executed and ViewState["FName"] is still empty ????
Why ?
Chris
I have a Webform with 1 submit button and 1 label
code behind :
public class MainWebForm: System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label lblFName;
protected override void LoadViewState( object o )
{
lblFName.Text = (string)ViewState["FName"];
}
protected override object SaveViewState()
{
ViewState["FName"] = "Enter First Name Here";
return base.SaveViewState();
}
}
Upon loading the page the first time
- LoadViewState() is executed but ViewState["FName"] is empty --> normal
- SaveViewState() event is executed as well and saves a value in the
ViewState-object
Page is now displayed with an empty label : OK
Upon pressing the Submit button : page loads a second time
- LoadViewState() is executed and ViewState["FName"] is still empty ????
Why ?
Chris