Failed to load viewstate error
-
Hello, I have an ASP.NET form with two
DIV
s (both withrunat=server
). The first one contains all the controls, buttons and instructions. The second one only contains a success message (just text). In myPage_Load
handler, I hide the secondDIV
, and in myOnClick
handler I hide the firstDIV
and show the secondDIV
only if the operation was successful. I had implemented something like this before (not using codebehind the other time, this time I am) and it worked flawlessly. When I click on the Send button, I get anHttpException
about failure to load viewstate. Any ideas? -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
-
Hello, I have an ASP.NET form with two
DIV
s (both withrunat=server
). The first one contains all the controls, buttons and instructions. The second one only contains a success message (just text). In myPage_Load
handler, I hide the secondDIV
, and in myOnClick
handler I hide the firstDIV
and show the secondDIV
only if the operation was successful. I had implemented something like this before (not using codebehind the other time, this time I am) and it worked flawlessly. When I click on the Send button, I get anHttpException
about failure to load viewstate. Any ideas? -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
It may depend on where you are enabling them. I developed a library called "RJContent Panel" (posted as an article here on CP) which dynamically displays a web user control in the specified content area of a template page. I kept getting load viewstate errors if I would create the dynamic control in the page load after the Init. When I switched the process to the Init, it was all okay. I believe the postback should have the same controls available as when the page was created in order for the viewstate to load properly. Rocky <>< Opps.. Here you go!
-
It may depend on where you are enabling them. I developed a library called "RJContent Panel" (posted as an article here on CP) which dynamically displays a web user control in the specified content area of a template page. I kept getting load viewstate errors if I would create the dynamic control in the page load after the Init. When I switched the process to the Init, it was all okay. I believe the postback should have the same controls available as when the page was created in order for the viewstate to load properly. Rocky <>< Opps.. Here you go!
hi are u using datagrid anywhere in ur project..... if it is then perhaps problem can be traced coz i been getting such prob and i did solve it.. so, plz let me know if it is.. munawar
-
hi are u using datagrid anywhere in ur project..... if it is then perhaps problem can be traced coz i been getting such prob and i did solve it.. so, plz let me know if it is.. munawar
munawarhussain wrote: are u using datagrid anywhere in ur project No, not in this form. It's a simply contact form, with a few text boxes plus a multiline text box and a Send button. When the button is clicked, I send the message by e-mail, and if successful, I hide the
DIV
with the form, and make visible theDIV
that contains the success message. If an error occurs, the form is kept visible and an error message is displayed. (edit) TheDIV
is hidden in thePage_Load
handler, and it works well, the first time only the controls appear and not the success message. When I click the Send button, the exception is thrown, I believe, when I try to hide the controls'DIV
, or later when the form is trying to reload the viewstate and it can't find the controls.(end edit) What is driving me nuts is that I did this exact same thing in a reusable contact form (which contains its code in the same.aspx
and not in a codebehind.cs
file) and it works perfectly. Thanks for your reply, -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
-
munawarhussain wrote: are u using datagrid anywhere in ur project No, not in this form. It's a simply contact form, with a few text boxes plus a multiline text box and a Send button. When the button is clicked, I send the message by e-mail, and if successful, I hide the
DIV
with the form, and make visible theDIV
that contains the success message. If an error occurs, the form is kept visible and an error message is displayed. (edit) TheDIV
is hidden in thePage_Load
handler, and it works well, the first time only the controls appear and not the success message. When I click the Send button, the exception is thrown, I believe, when I try to hide the controls'DIV
, or later when the form is trying to reload the viewstate and it can't find the controls.(end edit) What is driving me nuts is that I did this exact same thing in a reusable contact form (which contains its code in the same.aspx
and not in a codebehind.cs
file) and it works perfectly. Thanks for your reply, -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
If you can post some code (simply test app) that fails, I can look at it and see what the problem is. Rocky <>< Oh ya.. Here you go![^]