Getting rid of viewstate in GET posted forms

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
 
N

Natty Gur

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
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top