473,664 Members | 3,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ViewState Size Reduced, but not Completely Empty

I'm trying to optimize performance of a few pages. Toward this result, I
have done the following:
1. set EnableViewState ="false" and EnableSessionSt ate="false" in the @ Page
directive.
2. set EnableViewState ="false" in the @ Control directive of two user
controls that appear on the page
3. set EnableViewState ="false" for each of 16 imageButtons that are declared
on the page.

Just wondering why I still see a long string stored in __VIEWSTATE when I
view the source of the page from IE (View | Source). Completing the steps
listed above significantly reduced the size of the __VIEWSTATE content, but
it still contains more than 800 bytes). What could still be storing
information in ViewState?

Thanks in advance.
Nov 18 '05 #1
1 1156
If you dont need to post back you can remove the runat="server" from
the form tag - this should eliminate viewstate completely.

Even when you disable viewstate at the page level there is still a
little left behind by the page - but 800 bytes seems a bit excessive.

--
Scott
http://www.OdeToCode.com

On Mon, 19 Jan 2004 14:26:08 -0800, "Jeff S" <Ya*****@OkeyDo key.com>
wrote:
I'm trying to optimize performance of a few pages. Toward this result, I
have done the following:
1. set EnableViewState ="false" and EnableSessionSt ate="false" in the @ Page
directive.
2. set EnableViewState ="false" in the @ Control directive of two user
controls that appear on the page
3. set EnableViewState ="false" for each of 16 imageButtons that are declared
on the page.

Just wondering why I still see a long string stored in __VIEWSTATE when I
view the source of the page from IE (View | Source). Completing the steps
listed above significantly reduced the size of the __VIEWSTATE content, but
it still contains more than 800 bytes). What could still be storing
information in ViewState?

Thanks in advance.


Nov 18 '05 #2

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

Similar topics

8
4274
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue which is related to the repeater. In the code shown below, if I call Repeater1.Controls.Count in the OnInit (the code fragment was highlighted in yellow) , the viewstate for the repeater will be lost during the postback. You can re-produce this...
2
1544
by: Alejandro Penate-Diaz | last post by:
Hi. I am trying to reduce a DataGrid viewstate info by doing what this article says: http://authors.aspalliance.com/JimRoss/Articles/DatagridDietPartTwo.aspx .. I need to disable viewstate for all columns exept my button columns. Problem is that I can not access the Label controls within datagrid cells. I tried: TableCell Cell3 = e.Item.Cells; ((Label)Cell3.Controls).Text; but then I get empty strings. Also inside a cell I found...
1
2317
by: Jonathan | last post by:
Hello, I'm writed a WebCustomControl but I can't mantain the viewstate this is the code of my WebCustomContol: public class WebCustomControl1 : System.Web.UI.WebControls.WebControl, IPostBackEventHandler { public event EventHandler DoPostBack; protected override void Render(HtmlTextWriter output) {
10
3077
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
1
1398
by: John | last post by:
I'm having problems controlling viewstate size in ASP.NET 2.0. I have a repeater, which contains a gridview, which contains another gridview. All this is databound to produce a 100page report (for printing). No postback needed, no viewstate needed. I've set EnableViewState="false" on everything I can see, including all the controls, the form and the page itself. But the viewstate is still 10 lines in notepad (without wrapping!). I...
10
1626
by: Lloyd Dupont | last post by:
When you define UserControl in source code the sample I see are often like that: ============ public string Text { get { String s = (String)ViewState; return ((s == null) ? String.Empty : s); }
1
1968
by: Mark Olbert | last post by:
I have a "master" composite control which, in turn, holds an instance of a "detail" composite control (the "master" control will ultimately contain multiple instances of the "detail" control, but I'm keeping things simple to try and figure out what's going wrong). The master control supports databinding. Upon postback, the detail control is not retrieving its state from ViewState after it is created and added to the master control during...
6
2079
by: AAOMTim | last post by:
I have a large ViewState and I've heard I can save the ViewState in a sesison object. What are the advantages of doing so and how do I do it? I've been told that I am gettign DNS timeouts because of the ViewState being too large. I'm trying to avoid writing manual paging routines for now. -- Tim
40
2439
by: jayapal | last post by:
Hi all, We have large code on which we are solving the bugs. For every bug we change the code part either add or delete some of the code part. More is adding the code part and very less is deleting the code. But the question is , after build the object file( changed code) size is less than the object file ( unchanged code)???. As we increased the lines of code the object file size should be increased but here it
0
8437
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8861
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7375
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4185
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1759
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.