Viewstate wont turn off even after setting it to off !

Discussion in 'ASP .Net' started by robert112, Apr 26, 2007.

  1. robert112

    robert112 Guest

    Hi All,
    I have a webpage.aspx and a webusercontrol.ascx with both of them
    having viewstate turned off.

    Then in my web user control I have got some code reading the request
    stream:

    Dim str As IO.Stream
    Dim strLen As Integer
    Dim strRead As Integer

    str = Request.InputStream
    strLen = Integer.Parse(str.Length.ToString())
    Dim strArr(strLen) As Byte
    strRead = str.Read(strArr, 0, strLen)

    System.Text.Encoding.ASCII.GetString(strArr, 0,
    strLen).Substring(iStartIndex)

    when I put a break point on the last line I get the following output:
    "__VIEWSTATE=dDwtNzkxMjYyODQ5Ozs%2BRIdmzZpk4%2FEHqMI3MlRLHut43bA
    %3D&asdf=on&asdf=Robert+Hormozi&IncDisplayForm1%3AbtnSubmit=Submit"

    I don't want this viewstate string I need what the html code looks
    like in plain html. Is there anyway to do that ? Why is viewstate
    still on even after I turn it off?

    Thanks!
     
    robert112, Apr 26, 2007
    #1
    1. Advertising

  2. re:
    !> Why is viewstate still on even after I turn it off?

    You will always have a relatively short string representing the page itself even if you
    turn off the view state on each and every control, on the page, or in web.config.

    Don't worry about the 20 or so bytes which remain after you've turned off viewstate.
    They don't mean much.

    For a detailed explanation, see :
    http://aspnetresources.com/articles/ViewState.aspx



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ===================================
    "robert112" <> wrote in message
    news:...
    > Hi All,
    > I have a webpage.aspx and a webusercontrol.ascx with both of them
    > having viewstate turned off.
    >
    > Then in my web user control I have got some code reading the request
    > stream:
    >
    > Dim str As IO.Stream
    > Dim strLen As Integer
    > Dim strRead As Integer
    >
    > str = Request.InputStream
    > strLen = Integer.Parse(str.Length.ToString())
    > Dim strArr(strLen) As Byte
    > strRead = str.Read(strArr, 0, strLen)
    >
    > System.Text.Encoding.ASCII.GetString(strArr, 0,
    > strLen).Substring(iStartIndex)
    >
    > when I put a break point on the last line I get the following output:
    > "__VIEWSTATE=dDwtNzkxMjYyODQ5Ozs%2BRIdmzZpk4%2FEHqMI3MlRLHut43bA
    > %3D&asdf=on&asdf=Robert+Hormozi&IncDisplayForm1%3AbtnSubmit=Submit"
    >
    > I don't want this viewstate string I need what the html code looks
    > like in plain html. Is there anyway to do that ? Why is viewstate
    > still on even after I turn it off?
    >
    > Thanks!
    >
     
    Juan T. Llibre, Apr 26, 2007
    #2
    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. Tarun Mistry
    Replies:
    5
    Views:
    1,592
    Tarun Mistry
    Feb 25, 2006
  2. ABC
    Replies:
    0
    Views:
    429
  3. Stan Goodman

    Even older fart, even newer newbie

    Stan Goodman, Jul 3, 2003, in forum: Java
    Replies:
    11
    Views:
    704
    Stan Goodman
    Jul 4, 2003
  4. robert112

    why wont viewstaet turn off?

    robert112, Apr 26, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    384
    Juan T. Llibre
    Apr 26, 2007
  5. techie
    Replies:
    3
    Views:
    161
    Curt_C [MVP]
    Sep 17, 2003
Loading...

Share This Page