473,549 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

enableviewstate =false, still viewstate information is added

Hi

Even though the Viewstate has been disabled, ASP.NET
still uses about twenty bytes for Viewstate.

Not only can you disable Viewstate at the page level, but
you can also disable Viewstate at the control level. For
example, the following code disables Viewstate for a
ListBox control:
<asp:listbox EnableViewState ="false" id="ListBox1"
runat="server" Rows="10"></asp:listbox>

You can also disable Viewstate for the entire application
in the web.config file:
<configuratio n>
<system.web>
<pages buffer="true"
EnableViewState ="true" />
</system.web>
</configuration>

HTH
Ravikanth

-----Original Message-----
Hello.

I'm adding some controls at runtime, and I've set enableviewstate =false inmy aspx page.
Still, it adds viewstate information for my page. This seems only to applywhen I'm adding a checkboxlist, allthough I'm not sure that this is thecase. I've even tried setting enableviewstate =false for the controls.I really don't need this extra information, and I can't understand why it'sbeeing added, because I've set the viewstate to false..
C.H
.

Nov 17 '05 #1
1 4052
Hmm...I've added that information to my web.config file, still I get this
much viewstate information:

<input type="hidden" name="__VIEWSTA TE" value="dDwxMDAz NDU0NTMwOztsPHJ lcFF1
aXpRdWVzdGlvbjp fY3RsMTc6cXVlc3 Rpb25fODow
O3JlcFF1aXpRdWV zdGlvbjpfY3RsMT c6cXVlc3Rpb
25fODoxO3JlcFF1 aXpRdWVzdGlvbjp fY3RsMTc6cX
Vlc3Rpb25fODoyO 3JlcFF1aXpRdWVz dGlvbjpfY3Rs
MTc6cXVlc3Rpb25 fODozO3JlcFF1aX pRdWVzdGlvbj
pfY3RsMTc6cXVlc 3Rpb25fODozO3Jl cFF1aXpRdWVz
dGlvbjpfY3RsMTk 6cXVlc3Rpb25fOT owO3JlcFF1aXpR
dWVzdGlvbjpfY3R sMTk6cXVlc3Rpb2 5fOToxO3JlcFF1a
XpRdWVzdGlvbjpf Y3RsMTk6cXVlc3R pb25fOToyO3JlcF F1
aXpRdWVzdGlvbjp fY3RsMTk6cXVlc3 Rpb25fOTozO3Jlc FF1
aXpRdWVzdGlvbjp fY3RsMTk6cXVlc3 Rpb25fOTozO3Jlc FF1
aXpRdWVzdGlvbjp fY3RsMjE6cXVlc3 Rpb25fMTA6MDtyZ X
BRdWl6UXVlc3Rpb 246X2N0bDIxOnF1 ZXN0aW9uXzEwOjE
7cmVwUXVpelF1ZX N0aW9uOl9jdGwyM TpxdWVzdGlvbl8x MD
oyO3JlcFF1aXpRd WVzdGlvbjpfY3Rs MjE6cXVlc3Rpb25 fMTA6
MztyZXBRdWl6UXV lc3Rpb246X2N0bD IxOnF1ZXN0aW9uX zEw
OjQ7cmVwUXVpelF 1ZXN0aW9uOl9jdG wyMTpxdWVzdGlvb l8xM
Do0Oz4+W/Gaa6CwxccKDvHCV nbf0yLMFJU=" />
That seems as an awful lot of information! It only happens when I use
checkboxlist
Regards C.H
Nov 17 '05 #2

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

Similar topics

0
4044
by: Dave Verwer | last post by:
Hi I have a problem which is easily reproducable using VS.NET 2003 and the .Net framework 1.1 (not tested with framework 1.0) regarding disabling ViewState for dynamically created controls. Basically setting EnableViewState=false on controls created dynamically does not stop the viewstate being stored! I have tried this at the control...
1
1127
by: Ravikanth[MVP] | last post by:
Hi Even though the Viewstate has been disabled, ASP.NET still uses about twenty bytes for Viewstate. Not only can you disable Viewstate at the page level, but you can also disable Viewstate at the control level. For example, the following code disables Viewstate for a ListBox control:
5
14754
by: JollyK | last post by:
Hello all, I have always been having this issue and wondering what the solution is. When I set the enableviewstate property to false for a textbox, the textbox always retains its value after a postback occurs. Why is this? I want the textbox to become empty after postback. How can I do it without setting textbox.text = "" and without doing...
4
3110
by: Bruce Chao | last post by:
I tried to turn off viewstate and so I added enableViewState=false in side the Page directive, rebuild the page, test it. - not working Then I set all controls on the page so all their enableViewState is also false -- still, not working. After doing al these, I still see the hidden viewstate variable in the HTML source. Please...
7
2092
by: Brian Henry | last post by:
Hi, I want EnableViewState = false turned on to optimize the end output page (it was over 600KB with it on) but when i turn it off, our pageing functionality no longer works mainly the PageIndexChanged event no longer fires, how do you handle this with enable view state as false? thanks!
2
1974
by: michele | last post by:
Hi, i'm using a datagrid control in my webform, with AutoGenerateColumns=false; it work very well if EnableViewState=true; including paging and sorting, but this cause a big performance issue, so i've decided to set EnableViewState=false: now the events related to the datagrid have some strange behavours: for example the PageIndexChangedEvent...
6
1929
by: Chris | last post by:
I've created two textboxes and one button on my web form. I then set the EnableViewState property of Textbox1 to False. Textbox2 is set to True. The button has no code in it - It simply has an auto post back which reloads the page. I run the web application and type "test 1" into Textbox1 and "test 2" into Textbox2. I click the button...
2
2907
by: teo | last post by:
I have a Listbox, if I set EnableViewStarte = False the AutopostaBack fired by SelectedIndexChanged doesn't work. The 'SelectedIndexChanged' event should call
1
2055
by: =?Utf-8?B?VmlkZHM=?= | last post by:
Hi All, I am not able to get the sort event when i EnableViewState =false for data grid. Is there any relation betwn those two.Please comment. How can I get through this problem? Thanks in advance. Regards,
0
7461
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7730
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. ...
1
7491
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7823
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
6055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5101
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
3509
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
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.