Can't access sending Web Forrm's ViewState

D

Dee

Hi
I have added

EnableViewStateMac="false"

to the sending WebForm's @Page Directive and my sample code has the
following line:

Dim coll As System.Collections.Specialized.NameValueCollection
collForm = Request.Form
Dim n As Int16 = collForm.Count ' <-------- I get zero for this.

Why do I get an empty collection where the sending WebForm has many
server-side controls on it?

Thanks.
Dee
 
D

Dee

Actually when I attempt to go to the second page using:

Server.Transfer("result.aspx", True)

I get the following error message:

~~~~
The View State is invalid for this page and might be corrupted.
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.Web.HttpException: The View State is invalid
for this page and might be corrupted.

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:
[HttpException (0x80004005): The View State is invalid for this page and
might be corrupted.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain()
~~~~
 
D

Dee

Got it, had to include EnableViewStateMac="false" in both sending and
receiving codebehinds.


Dee said:
Actually when I attempt to go to the second page using:

Server.Transfer("result.aspx", True)

I get the following error message:

~~~~
The View State is invalid for this page and might be corrupted.
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.Web.HttpException: The View State is invalid
for this page and might be corrupted.

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:
[HttpException (0x80004005): The View State is invalid for this page and
might be corrupted.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain()
~~~~


Dee said:
Hi
I have added

EnableViewStateMac="false"

to the sending WebForm's @Page Directive and my sample code has the
following line:

Dim coll As System.Collections.Specialized.NameValueCollection
collForm = Request.Form
Dim n As Int16 = collForm.Count ' <-------- I get zero for this.

Why do I get an empty collection where the sending WebForm has many
server-side controls on it?

Thanks.
Dee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,616
Members
45,306
Latest member
TeddyWeath

Latest Threads

Top