Getting rid of viewstate in GET posted forms

  • Thread starter Thread starter damonf
  • Start date Start date
D

damonf

I'm trying to post data in ASP.NET using the GET method
for the form rather than POST. I've disabled viewstate
on all the controls and at the page level but I still
keep getting _Viewstate in the URL. Is there any way to
control aspx pages so they display tidy querystrings
without all the other stuff?

Thanks

Damon
 
Hi,

Well, as long as the form holds the runat=server attributes ASP.NET will
render __viewstate even if you disable view state for all page controls
and page. if you will remove runat=server attribute toy cant use server
control at this form.

there are two workaround :

1) use client side script to remove __viewstate field before submitting
the form.

2) create dynamically or statically other form without runat=server
attribute, add your fields and data and submit that form.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
Back
Top