disable ViewState ?

G

George Ter-Saakov

on my page I have
<%@ Page Language="C#" EnableViewState="false"%>

But in HTML i still see __VIEWSTATE hidden variable.

<form name="form1" method="post" action="......" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJMTQ4MzQwNDAwZGQTxfqLHt6P7WAXU/Mbh/hWT54/7Q==" />
</div>



why is that and how can i disbale ViewState completelly?

I am using NET 2.0



thanks

George
 
M

Mark Fitzpatrick

something you can do is to look at the trace output for that page by
enabling tracing in the web.config. The trace output will show the size in
bytes for each control's viewstate. There could be a control in the page
that doesn't inherit it's settings from the page itself that you can then
try turning off the viewstate for that control.
 
E

Eliyahu Goldin

It will be always there. Do you think an extra Kbyte will affect your page
performance? You will find yourself in a lot of scenarios where you do want
ViewState.
 
K

Karl Seguin [MVP]

It's generated by/for the <form runat="server" ... >

the only way to remove it is to take out the form tag, which won't work for
most aspx pages.

trace=true is a great idea, incase I'm wrong :)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


Eliyahu Goldin said:
It will be always there. Do you think an extra Kbyte will affect your page
performance? You will find yourself in a lot of scenarios where you do
want ViewState.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


George Ter-Saakov said:
on my page I have
<%@ Page Language="C#" EnableViewState="false"%>

But in HTML i still see __VIEWSTATE hidden variable.

<form name="form1" method="post" action="......" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJMTQ4MzQwNDAwZGQTxfqLHt6P7WAXU/Mbh/hWT54/7Q==" />
</div>



why is that and how can i disbale ViewState completelly?

I am using NET 2.0



thanks

George
 
G

George Ter-Saakov

Thanks everyone for a suggestions.
Not like extra 10 bytes going to make a difference but I just like my staff
to be clean and if I said that I do not want a Viewstate I mean it and want
..NET 2.0 to respect it :)


George.


"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:[email protected]...
It's generated by/for the <form runat="server" ... >

the only way to remove it is to take out the form tag, which won't work
for most aspx pages.

trace=true is a great idea, incase I'm wrong :)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


Eliyahu Goldin said:
It will be always there. Do you think an extra Kbyte will affect your
page performance? You will find yourself in a lot of scenarios where you
do want ViewState.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


George Ter-Saakov said:
on my page I have
<%@ Page Language="C#" EnableViewState="false"%>

But in HTML i still see __VIEWSTATE hidden variable.

<form name="form1" method="post" action="......" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJMTQ4MzQwNDAwZGQTxfqLHt6P7WAXU/Mbh/hWT54/7Q==" />
</div>



why is that and how can i disbale ViewState completelly?

I am using NET 2.0



thanks

George
 
E

Eliyahu Goldin

You will save a lot of time and nerves if you will respect asp.net too.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


George Ter-Saakov said:
Thanks everyone for a suggestions.
Not like extra 10 bytes going to make a difference but I just like my
staff to be clean and if I said that I do not want a Viewstate I mean it
and want .NET 2.0 to respect it :)


George.


"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:[email protected]...
It's generated by/for the <form runat="server" ... >

the only way to remove it is to take out the form tag, which won't work
for most aspx pages.

trace=true is a great idea, incase I'm wrong :)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


Eliyahu Goldin said:
It will be always there. Do you think an extra Kbyte will affect your
page performance? You will find yourself in a lot of scenarios where you
do want ViewState.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


on my page I have
<%@ Page Language="C#" EnableViewState="false"%>

But in HTML i still see __VIEWSTATE hidden variable.

<form name="form1" method="post" action="......" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJMTQ4MzQwNDAwZGQTxfqLHt6P7WAXU/Mbh/hWT54/7Q==" />
</div>



why is that and how can i disbale ViewState completelly?

I am using NET 2.0



thanks

George
 
G

Guest

So, what this do:

<%@ Page EnableViewState="false" %>

If it doesn't get rid of the 10 pages of ViewState text on my web form,
what's the point? This page displays a DataGrid and I don't see any reason
to want ViewState -- especially since it's transferring thousands of bytes of
text.
Thanks
/Ken
 
E

Eliyahu Goldin

If you disable viewstate, you won't have the 10 pages. You will still have
the __VIEWSTATE hidden variable but it will be much smaller. And you can
always disable viewstate for controls individually.
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top