__VIEWSTATE

  • Thread starter Thread starter Greg Phillips
  • Start date Start date
G

Greg Phillips

I have a page, with an iframe in it.
the iframe loads up another ASPX page, I have set both pages
enableviewstate=false

The problem is, if I click on anything on the main page, it gives me a
viewstate corrupt error,

How do I turn the viewstate checking of these pages off completely...
 
Hi Greg in the page attribute where you ahve specified EnableViewState=false;
also set the EnableViewStateMac=false.

Microsoft says The EnableViewStateMac is not intended to be used directly
from your code. as .Net framework takes care about it. but in realistic
scenario it doesn't seems so. u need to set this to false, as it will create
some problem majorily when you are disabling Viewstate and sometimes also
working with Crystal Reports.

Hope this helps you out.
 
hi,

When you include an .aspx file within another .aspx file, actually it works
fine...no need to set any viewstate property for that explicitly...

regards,
Kannan
 
Hi Praveen
thanks for the reply... i tried your advice, though i get this error
now...

Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not
valid.

Source Error:

An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidCastException: Specified cast is not valid.]
System.Web.UI.Page.LoadPageViewState() +30
System.Web.UI.Page.ProcessRequestMain() +423
 
Unfortunately , not for me...

Is there a way to override a method to not load up the viewstate...

GP
 
Hi Greg, I dont this is a problem because of the ViewState, this is because
youa re trying to cast a object which is not supported check your code this
time. or load the lines where you are facing this problem.
 
Hi Praveen

Thanks for the feedback... though i am not recieving an exception from my
code, the stack trace shows that the exception is thrown in
ProcessRequestMain
...

is there a way for me to override some function that will not let the
viewstate be loaded... load nothing..

GP



Praveen K said:
Hi Greg, I dont this is a problem because of the ViewState, this is
because
youa re trying to cast a object which is not supported check your code
this
time. or load the lines where you are facing this problem.

G P said:
Hi Praveen
thanks for the reply... i tried your advice, though i get this error
now...

Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not
valid.

Source Error:

An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidCastException: Specified cast is not valid.]
System.Web.UI.Page.LoadPageViewState() +30
System.Web.UI.Page.ProcessRequestMain() +423
 
Hi GP:

You can override SavePageStateToPersistenceMedium and
LoadPAgeStateFromPersistanceMedium. If you google for these methods
you'll even find some articles where people keep viewstate on the
server side.
 
No not at all...

Currently its being developed on my local machine, and when it moves to
production it shall be on a single machine...

whats your idea with the viewstate?
 
do you know how to turn the viewstate off completly.... even if the
__viewstate variable is passed to the page?
 
Back
Top