473,544 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is there any way to avoid __VIEWSTATE hidden field in the page

Hi,

I am not using view state.I disabled the view state, but this hidden
__VIEWSTATE variable and some text is coming when we are taking the
view source.Is there any way to remove this variable?

Reju

Mar 6 '07 #1
7 9279
Hi

You just cant get rid completely of the __VIEWSTATE field, it will always
contain a few bytes that are used internally and dont relate to your
control's state.

Adlai
-------------------------------------
If my answer helped you please press "Yes" bellow

אם תשובה זו עזרה לך, א*א הצבע "כן"

Adlai Maschiach
http://blogs.microsoft.co.il/blogs/adlaim/
"reju" wrote:
Hi,

I am not using view state.I disabled the view state, but this hidden
__VIEWSTATE variable and some text is coming when we are taking the
view source.Is there any way to remove this variable?

Reju

Mar 6 '07 #2
On Mar 6, 8:04 am, "reju" <rejumgeo...@gm ail.comwrote:
Hi,

I am not using view state.I disabled the view state, but this hidden
__VIEWSTATE variable and some text is coming when we are taking the
view source.Is there any way to remove this variable?

Reju
You can override two page methods (available in ASP.NET 2.0) -
Page.LoadPageSt ateFromPersiste nceMedium() and
Page.SavePageSt ateToPersistenc eMedium(viewSta te) to store viewstate in
Session / Cache / SQL with the need to send it to the client (by
default). More info can be found here:

http://www.codeproject.com/aspnet/Pe...tStatePage.asp

Mar 6 '07 #3
Set EnableViewState to false in the page directive or in the app's web.config.

Per page (in directive) : <%@ Page EnableViewState ="False" ... %>
Per application (in web.config) : <Pages EnableViewState ="false" ... />

You can also disable it for individual controls.

Doing that will reduce viewstate to a very small size.

If you want to disable it completely ( remove it ), see Natty Gur's sample code :

http://weblogs.asp.net/ngur/archive/.../08/85876.aspx


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
=============== =============== =====
"reju" <re*********@gm ail.comwrote in message
news:11******** *************@n 33g2000cwc.goog legroups.com...
Hi,

I am not using view state.I disabled the view state, but this hidden
__VIEWSTATE variable and some text is coming when we are taking the
view source.Is there any way to remove this variable?

Reju


Mar 6 '07 #4
"Adlai Maschiach" <Ad************ @discussions.mi crosoft.comwrot e in
message news:46******** *************** ***********@mic rosoft.com...
You just cant get rid completely of the __VIEWSTATE field,
Yes you can: http://weblogs.asp.net:80/ngur/archi.../08/85876.aspx
Mar 6 '07 #5
On Mar 6, 1:06 pm, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e:
Set EnableViewState to false in the page directive or in the app's web.config.

Per page (in directive) : <%@ Page EnableViewState ="False" ... %>
Per application (in web.config) : <Pages EnableViewState ="false" ... />

You can also disable it for individual controls.

Doing that will reduce viewstate to a very small size.

If you want to disable it completely ( remove it ), see Natty Gur's sample code :

http://weblogs.asp.net/ngur/archive/.../08/85876.aspx

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en espaol :http://asp.net.do/foros/
=============== =============== ====="reju" <rejumgeo...@gm ail.comwrote in message

news:11******** *************@n 33g2000cwc.goog legroups.com...
Hi,
I am not using view state.I disabled the view state, but this hidden
__VIEWSTATE variable and some text is coming when we are taking the
view source.Is there any way to remove this variable?
Reju
Hi Juan,
when I override the SavePageStateTo PersistenceMedi um method my submitt
buttons are not working,
I can't navigate to next page
Reju

Mar 6 '07 #6
On Mar 6, 1:06 pm, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e:
Set EnableViewState to false in the page directive or in the app's web.config.

Per page (in directive) : <%@ Page EnableViewState ="False" ... %>
Per application (in web.config) : <Pages EnableViewState ="false" ... />

You can also disable it for individual controls.

Doing that will reduce viewstate to a very small size.

If you want to disable it completely ( remove it ), see Natty Gur's sample code :

http://weblogs.asp.net/ngur/archive/.../08/85876.aspx

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en espaol :http://asp.net.do/foros/
=============== =============== ====="reju" <rejumgeo...@gm ail.comwrote in message

news:11******** *************@n 33g2000cwc.goog legroups.com...
Hi,
I am not using view state.I disabled the view state, but this hidden
__VIEWSTATE variable and some text is coming when we are taking the
view source.Is there any way to remove this variable?
Reju
Hi Juan,
when I override the SavePageStateTo PersistenceMedi um method my submit
buttons are not working,
I can't navigate to next page
Reju

Mar 6 '07 #7
You have to weigh the pros and cons of disabling Viewstate
and determine whether disabling it is a good policy for you.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
=============== =============== =====
"reju" <re*********@gm ail.comwrote in message
news:11******** *************@q 40g2000cwq.goog legroups.com...
On Mar 6, 1:06 pm, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e:
Set EnableViewState to false in the page directive or in the app's web.config.

Per page (in directive) : <%@ Page EnableViewState ="False" ... %>
Per application (in web.config) : <Pages EnableViewState ="false" ... />

You can also disable it for individual controls.

Doing that will reduce viewstate to a very small size.

If you want to disable it completely ( remove it ), see Natty Gur's sample code :

http://weblogs.asp.net/ngur/archive/.../08/85876.aspx

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en espaol :http://asp.net.do/foros/
=============== =============== ====="reju" <rejumgeo...@gm ail.comwrote in message

news:11******** *************@n 33g2000cwc.goog legroups.com...
Hi,
I am not using view state.I disabled the view state, but this hidden
__VIEWSTATE variable and some text is coming when we are taking the
view source.Is there any way to remove this variable?
Reju
Hi Juan,
when I override the SavePageStateTo PersistenceMedi um method my submit
buttons are not working,
I can't navigate to next page
Reju
Mar 6 '07 #8

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

Similar topics

2
1975
by: Me | last post by:
Is there anyway to control the style/layout of this field? ..NET doesn't generate an ID for it so you can create a style for it or manipulate it in code. I've looked on MSDN etc. but can't find the answer. Thanks in advance, RWK
10
2964
by: Jason Pettys | last post by:
I have an ASP.NET page that my client wants to e-mail. So in IE we choose File > Send > Page by E-mail, which opens up either Outlook or Outlook Express with the HTML page content as the message body. EXCEPT one nasty detail is that in the e-mail client, <input type="hidden"> elements are rendered as text boxes, which the __VIEWSTATE is one...
4
3617
by: Magnus Blomberg | last post by:
Hello! I have a problem when using a hidden field to send a value to the server. Below you can see my code in simplyfied versions. What I'm trying to do is: 1. The user browses for a picture at the network from their computer using control File1. 2. The user clickes the button Commit picture (with id CliBtn) a. The script is running at...
2
3003
by: GTi | last post by:
I have a ASP 2.0 page where I use some Ajax code. The Ajax code (JavaScript) is inserted from CodeBehind. In my page I have a submit button and some links for Ajax functions. When I load the page and use the submit button it give me some results that is fine. Then I press the links that activate the Ajax Code the results is displayed fine on...
0
4273
by: msnews.microsoft.com | last post by:
I have been raking my brains on why this does not work. I get back the same login screen again instead of the home page redirection which should occur after a successful login: 'create a cookie container so it can be shared between requests so that authentication can be maintained Dim objCookieCont As New CookieContainer 'create request...
1
1646
by: Eric | last post by:
Hello, I was testing my application on my localhost, when I View Source, I see the __VIEWSTATE and its only small in size (about 500 bytes). When I copy this same application over to our IIS server and then run it, again do a View Source, the __VIEWSTATE balloons to over 200,000 bytes. This is the exact same program, viewing on the...
0
1030
by: reju | last post by:
Hi, I am not using view state.I disabled the view state, but this hidden __VIEWSTATE variable and some text is coming when we are taking the view source.Is there any way to remove this variable? Reju
6
1690
by: Ivan Gasparetto | last post by:
Is it possible to change the __VIEWSTATE id? The reason is we shouldn't have any id starting with underscores on XHTML pages. Thank you
11
3085
by: viki1967 | last post by:
Hidden field Hello my friends. This is a htm page that contains a form open in window popUp ( page daughter ). This form insert a value in the one hidden field called "tec", in other form open in the page mother. As you can see the select contains multiple attribute.
0
7452
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7643
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7738
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5956
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4938
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3436
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
688
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.