In msdn, as they mentioned, view state values are loaded between page_init and page_initcomplete. It suggests that during the request for receiving I assign a value to the text property of the text field, as get with in page_load () { if(!IsPostBack) {textobx.text="get";}}. Thus, this value is stored in the viewstate and visible in the browser. And during my next postback, I assign a post value to the same text property in the event page_init. Since in msdn after the event, page_initcompletethis post value must be overridden by the get value. But this does not happen. Why?
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TextBox1.Text = "hello";
}
TextBox2.Text = TextBox1.Text.ToString();
}
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
TextBox1.Text = "init";
}
protected override void OnInitComplete(EventArgs e)
{
base.OnInitComplete(e);
TextBox1.Text = "init";
}
Textbox2.Text, . post back init Textbox2.Text. . ?