Strange Error !!!
Help please.. i was testing my application today and i get this error message for the first time
and i don't know what i did wrong.. or what causing it.. i didn't get this error before
only today..the error is :
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
please help me..it is driving me crazy.. because i tried to track it down using breakpoints but it didn't work
Regards,
Ninawell what are you doing? Are you adding controls dynamically? If so where do you do this?
It means you changed something about the code and then did a SUBMIT (clicked on something) from the pre-change version of the page.
You should always revisit your page fresh. If you believe you are visiting them fresh, then add to the Page_Load:
Response.Expires = -1;
Thanks Lord_Rat, but can you explain more please? what is page fresh?
It means that it's possible that the page you are loading is coming from your cache, rather than from the server. If it's from the cache, then the viewstates will not match those 'expected' by the server, and you get that error.
By adding his code, you are telling the browser not to cache the page, so that everytime you visit that page, it is loaded afresh from the server, thereby eliminating the problem.
thank you mendhak you are always near when i need you.. :)
for more info about this thread, check this:
http://www.codecomments.com/archive315-2005-2-398077.html
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment