I have a lable control on the page which has EnableViewState=false. Also a button. When I click on the button a text is shown dynamically on the label. Since page has viewstate false, label text is lost when some other button clicked. I tried to get the PostBack value of the label in the OnInit function but looks like its empty. Anybody?
i can help you.. post your code, you're not really giving people enough to go on here. also, try the official asp.net forums if people can't help you here.
I solved it. Here is it. I just gonna use shorthand. <form> <asp:label id="lbl" runat="server"/> <asp:button id="btn1" onclick="showdata"/> <asp:button id="btn2" Text="refresh"/> </form> protected void btnShowAdmin_Click(object sender, System.EventArgs e) { lbl.Text="hello there."; Page.ClientScript.RegisterHiddenField("hidField", lbl.Text); } protected override void OnInit(EventArgs e) { if (Request["hidField"] != null) { lbl.Text = Request["hidField"]; Page.ClientScript.RegisterHiddenField("hidField", Request["hidField"]); } }