possible to remove Viewstate hidden field?

S

Stimp

Is it possible to prevent the <input type="hidden"
name="__VIEWSTATE"> field from being generated in an aspx page?

I'm running off Framework 1.1

The field is messing up a process that I need to run, so simply clearing
out the viewstate by overriding SavePageStateToPersistenceMedium, etc
isn't enough

Thanks in advance!
 
S

Scott M.

You can disable it at the page level (via the properties window or the page
directives line in the .aspx file), but that won't completely get rid of the
field. A minimum viewstate field will always be present. It should,
however, prevent the load and save viewstate methods from running.
 
S

Stimp

You can disable it at the page level (via the properties window or the page
directives line in the .aspx file), but that won't completely get rid of the
field. A minimum viewstate field will always be present. It should,
however, prevent the load and save viewstate methods from running.

I read on the net that it's possible to prevent the <input> field being
generated by not inheriting from the 'Page' class .. but it neglects to
mention what I should inherit from instead.

Any ideas?

cheers
 
S

Scott M.

Well, if you don't inherit from the page class, you are going to lose
virtually all the other benefits and characteristics of a Web Form.
ViewState is part of the fundamental architecture of ASP.NET. If you
absolutely can't make your application work because of it, ASP.NET may not
be the platform for you.
 

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

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top