By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,484 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

Viewstate wont turn off even after setting it to off !

P: n/a
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!

Apr 26 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <ro*******@tpg.com.auwrote in message
news:11**********************@r30g2000prh.googlegr 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!

Apr 26 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.