Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Viewstate wont turn off even after setting it to off !

Reply
Thread Tools

Viewstate wont turn off even after setting it to off !

 
 
robert112
Guest
Posts: n/a
 
      04-26-2007
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%2FEHq MI3MlRLHut43bA
%3D&asdf=on&asdf=Robert+Hormozi&IncDisplayForm1%3A btnSubmit=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!

 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      04-26-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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%2FEHq MI3MlRLHut43bA
> %3D&asdf=on&asdf=Robert+Hormozi&IncDisplayForm1%3A btnSubmit=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!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why my working ps/2 mouse freezes and even don't even get recon.after reboot ? demi General Computer Support 0 08-03-2007 05:30 AM
Why my working ps/2 mouse freezes and even don't even get recon.after reboot ? demi General Computer Support 0 08-03-2007 05:28 AM
why wont viewstaet turn off? robert112 ASP .Net 1 04-26-2007 01:41 AM
W98 APM Wont turn PC off Lanmeister NZ Computing 1 11-24-2004 06:47 AM
Arrrrgg!! Now it wont even turn on!! Global Thermonuclear War Computer Support 4 06-09-2004 02:49 PM



Advertisments