|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
"Failed to load viewstate" when clicking buttonHi,
I have a problem with an ImageButton inside a web user control. It works in some pages, but in others, it just keeps with the "Failed to load viewstate" error. Basically, the controls has a textbox and the imagebutton, which on the click event collects the textbox content and redirects to another page. The controls has been inserted in all pages by dragging and dropping. Can somebody help me? TIA Marcelo Marcelo,
It is possible that ViewState has been disabled on some pages. Check the page directives at the top. Also be sure you are accessing ViewState only after it has been loaded. http://msdn2.microsoft.com/en-us/ms227435.aspx Also be sure you are not setting the values of the control programatically during a PostBack. Usually you can just set properties as an attribute, but if you do it with code, wrap it in an IF block. If ( ! IsPostBack) { ... set control values ... } Brennan Stehling http://brennan.offwhite.net/blog/ Marcelo wrote: Show quoteHide quote > Hi, > > I have a problem with an ImageButton inside a web user control. It works in > some pages, but in others, it just keeps with the "Failed to load viewstate" > error. Basically, the controls has a textbox and the imagebutton, which on > the click event collects the textbox content and redirects to another page. > The controls has been inserted in all pages by dragging and dropping. > > Can somebody help me? > > TIA > > Marcelo
Menu Control Questions
CustomValidator points to wrong control Redirecting to another page GridView multiple DDL Javascript from treeview Gridview update does not work FileUpload Control in ASP 2.0. Re: Binding a single object to a control Disappearing asp:TreeView in a custom web control Need very very good web designer contractor (ASP.NET 2.0 themes) |
|||||||||||||||||||||||