473,408 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

disable ViewState ?

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
Oct 17 '06 #1
7 2106
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.

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"George Ter-Saakov" <gt****@cardone.comwrote in message
news:eE**************@TK2MSFTNGP05.phx.gbl...
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


Oct 17 '06 #2
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" <gt****@cardone.comwrote in message
news:eE**************@TK2MSFTNGP05.phx.gbl...
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


Oct 17 '06 #3
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" <RE**************************@mMvVpPsS.orgwrote in
message news:es**************@TK2MSFTNGP02.phx.gbl...
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" <gt****@cardone.comwrote in message
news:eE**************@TK2MSFTNGP05.phx.gbl...
>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



Oct 17 '06 #4
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
netwrote in message news:ua**************@TK2MSFTNGP03.phx.gbl...
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" <RE**************************@mMvVpPsS.orgwrote in
message news:es**************@TK2MSFTNGP02.phx.gbl...
>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" <gt****@cardone.comwrote in message
news:eE**************@TK2MSFTNGP05.phx.gbl...
>>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




Oct 17 '06 #5
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" <gt****@cardone.comwrote in message
news:uK**************@TK2MSFTNGP03.phx.gbl...
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
netwrote in message news:ua**************@TK2MSFTNGP03.phx.gbl...
>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" <RE**************************@mMvVpPsS.orgwrote in
message news:es**************@TK2MSFTNGP02.phx.gbl...
>>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" <gt****@cardone.comwrote in message
news:eE**************@TK2MSFTNGP05.phx.gbl...
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




Oct 17 '06 #6
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
"Eliyahu Goldin" wrote:
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]
Jan 19 '07 #7
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.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"ken s" <ke**@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
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
"Eliyahu Goldin" wrote:
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]


Jan 20 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Homa | last post by:
Hi, I have a datalist with linkbuttons embedded within. In order for the onClick event to fire, I need to have EnableViewState = true. But since there are quite a lot of data, simply enable...
1
by: Rhodri | last post by:
Hi all I have a datagrid which can display upto 20,000 records and the viewstate gets very big. I have tried turning of viewtate using EnableViewState = false both on the parent page and on the...
3
by: Stan | last post by:
Dispite the fact that ViewState="false" at the page level, and all controls have viewstate disabled, ViewState is still on the page (<input type="hidden" name="__VIEWSTATE" value="..." /> Why...
2
by: Fluxray | last post by:
--Background: I have a webform including a datagrid. The datagrid is using template. Its ItemTemplate is used to display a look-up-table with labels. its EditItemTemplate is used to edit a row in...
7
by: Jo Inferis | last post by:
For reasons that are unlikely to become clear at the moment, I have a page with some validation controls on it which opens a dialog. The dialog does *stuff* and then closes with a call to : ...
4
by: Umut Tezduyar | last post by:
I want to get rid of the hidden field _VIEWSTATE. I tried these: I tried to disable ViewState property. I tried to override Page's RegisterHiddenField method. I tried to override Page's...
6
by: sri_san | last post by:
Hello, I have a aspx page in which I would like to eliminate all of the hidden variables as this page would be imported to an email client and the hidden controls are usually rendered in the mail...
6
by: =?Utf-8?B?Unlhbg==?= | last post by:
Hi, I found out that Text property is perserved, but disable/enable status is not preserved, especially I change this setting of a server side text box with client side javascipt and then post...
4
by: =?Utf-8?B?TUNN?= | last post by:
I am trying to disable ViewState at the application level. I have the following line in my web.config: <pages enableViewState="false"></pages> But it is not working. What can I do?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.