Getting rid of viewstate in GET posted forms

Discussion in 'ASP .Net' started by damonf, Nov 3, 2003.

  1. damonf

    damonf Guest

    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
     
    damonf, Nov 3, 2003
    #1
    1. Advertising

  2. damonf

    Natty Gur Guest

    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


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Nov 3, 2003
    #2
    1. Advertising

  3. damonf

    damonf Guest

    Many thanks for the information.

    Damon

    >-----Original Message-----
    >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
    >
    >
    >*** Sent via Developersdex http://www.developersdex.com

    ***
    >Don't just participate in USENET...get rewarded for it!
    >.
    >
     
    damonf, Nov 8, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mariano Drago

    Cant get rid off viewstate

    Mariano Drago, Apr 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    488
    Mariano Drago
    Apr 9, 2004
  2. Simon
    Replies:
    1
    Views:
    451
    Henri
    Nov 9, 2004
  3. rgouge
    Replies:
    0
    Views:
    346
    rgouge
    Jul 29, 2005
  4. Tumurbaatar S.

    ViewState and posted back data

    Tumurbaatar S., Nov 27, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    159
    Sundararajan
    Nov 29, 2005
  5. Simon
    Replies:
    1
    Views:
    196
    Henri
    Nov 9, 2004
Loading...

Share This Page