Huge ViewState in GridView even when EnableViewState=False


what can I do to reduce the ViewState in the GridView?
I have EnableViewState=false and I have about 100 rows whithout paging.

I also have this in my GridView-Code:
<asp:TemplateField >
<ItemStyle wrap="False" horizontalalign="Right" />
<asp:imagebutton runat="server" imageurl="edit.gif" alternatetext="Edit" commandname="edit"
     causesvalidation="false" id="btnEdit"></asp:imagebutton><asp:imagebutton runat="server" id="btnDelete" imageurl="del.gif" alternatetext="Delete"
     commandname="delete" causesvalidation="False"></asp:imagebutton>
<asp:imagebutton runat="server" imageurl="save.gif" alternatetext="Update" commandname="update"
     causesvalidation="False" id="btnUpdate"></asp:imagebutton><asp:imagebutton runat="server" imageurl="cancel.gif" alternatetext="Cancel" commandname="cancel"
     causesvalidation="False" id="btnCancel"></asp:imagebutton>

Without this, I have a smaller ViewState but I need to have EDIT and UPDATE rows.
Is there any solutions for this problem?

Many thanks in advance for any help!

J. Bauer

5/30/2006 10:59:41 AM 72751 articles. 3 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 25


Similar Artilces:

Is ViewState still validated even when enableViewState="False" enableViewStateMac="False"
Does a aspx page get validated on the web server even if enableViewState="False" enableViewStateMac="False"? Thanks....   Pete A wrote: Does a aspx page get validated on the web server even if enableViewState="False" enableViewStateMac="False"? What do you mean by "Page get validated". Are you talking about the server side validation?Kumar Reddi If a web control depends on the ViewState (i.e. DropDownList) then you will have issues. So, you will also have issues with validation if ViewState is disabled.Ryan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan...

Viewstate too large although Gridview enableviewstate false!
Hi, I am using a gridview to display data in my application. Everything works great, however, even though I put 'enableviewstate="false"' in the <asp:gridview> tag, I get a very big bloated viewstate, which is not really desirable. The gridview handles paging and is included in an <atlas:updatepanel>.  I noticed that if I include no columns and just use <Columns></Columns> the viewstate is very small, as required. However, the moment I put in the bound and template fields, the viewstate becomes enourmous! Below there is a snippet of the code: <atl...

Dot Net 3.5 causes Exception with GridView using EnableViewState = false
 Ever since I upgraded to .net 3.5, I've got some gridviews where the first time the page loads, they load fine, but on postback I get the following on any gridviews that have their EnableViewState set to false:  Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: 'nslId'  Key being added: 'nslId'Stack Trace: [ArgumentException: Item has already been added. Key in dictionary: 'nslId' Key being added: 'nslId'] System.Collec...

Databinding on GridView cracks ViewState of controls containing in GridView
Hello, My problem is with GridView and is as follows: I have a GridView that has DataTable as its data source. There is also one unbound column containing check boxes, indicating which rows to delete when a Delete button on the form is clicked. In Delete button click event handler I remove selected rows from DataTable, rebind data on GridView. This works as expected. The problem comes when I want to disable header row when GridView is empty (contains zero rows). To do this I call myGridView.HeaderRow.Enabled = false. Actually this call does nothing and as a result I have the header enab...

gridview control in another gridview control
Hi ia have a questioni have a gridview control which contains button in one my question is i need another gridview to be placed in the  first gidviewso that when i click on the button the second gridview will populate the my question is how to place second gridview in first gridview.or is there any approach like first grid itself acting as parent and child.please help me  Hi sirikalavalapalli:                I think nested gridview will help you. Check this link and it will show you how...

Help Req: !!! :- On Disabling Controls Present inside a Gridview control
Hi All, We have A requirement Where we have disable controls inside a grid.These controls can be textbox, DropDownlist (in TemplateField), ComandField present inside the grid.We have to call a generic method for doing the same .(since it can be done for multiple grid.) PFB the code snippet we use. Which disables all the controls inside the page.The bolded part of the code is used to loop inside a grid view.(Not Working.)Is this ideal way to deal with the requirement.Or can someone suggest be a better way.        public void DisableMe(Page p1, st...

Gridview control embedded in another gridview control
I am writing an ambulance crew scheduling application on the web and I need some help completing the last part.  I have an access database that has three tables: user table, shift table (describing the shifts available), and a schedule table (that stores shift by shift_id and user by user_id).  I have a gridview control that will display the available shifts but I cannot get the embedded gridview control that will display the user that is signed up for each shift to display because I cannot figure out how to use the OnRowDataBound method.  I need a simple VB example of how to...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Master Details in two seperate GridView Controls
I am simply trying to have a list of people in the top grid control (works fine), then when selected have the second Grid Control show details for that person(not working). Here is what I am trying from the load event: Sub BindData() Dim myConnection As New MySql.Data.MySqlClient.MySqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionSql")) Dim strPersonSQL, strActSQL As String strPersonSQL = "select row_id, first_name, last_name, middle_initial, dsi_id, created, created_by, program_of_study, email from tbl_person" Dim myPerCommand As New MySqlClient.MySqlComm...

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

Datagrid(.net 1.1) to GridView(.net 2.0) and using the RowUpdating event how to extract the values from the controls.
Ok  This is the settings: I use a Viewgrid with only itemtemplate colums for example. <asp:TemplateField HeaderText="Test"><ItemTemplate><asp:Label id="LBL_Test" text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' runat="server" meta:resourcekey="LBL_TestResource1"></asp:Label></font></ItemTemplate> <EditItemTemplate><asp:TextBox ID="HDN_Test" Text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' Runat="server" meta:resourcekey="HDN_TestResource1" /></EditItemTemplate></asp:TemplateField>  The ...

There is a Gridview Control in the tmplate field of another GridView Control.
    For instance,a gridview displays the information of the  students in a class.A table is recording the information except their mark.There is another table recording the mark of the students whose foreign key is the primary key of the previous table.   string strSQLconnection=".................."; SqlConnection sqlCononection=new SqlConnection(strSQLconnection); SqlCommand sqlCommand=new SqlCommand("select * from stuendent where classID=1",sqlConnection); SqlConnection.Open(); SqlDataReader reader=sqlCommand.ExecuteReader(); GridVie...

PagerTemplate in GridView with EnableViewState = false
Hello, I have a question about the PagerTemplate of the GridView. I am trying to use the GridView inside another control, and insert this other control in a normal page. The control that has the GridView has also a SqlDataSource control for filling the GridView with Data. I would like to disable the ViewState of the control that has the GridView inside, and when I do this, the GridView controls does different things depending if I have set a custom PagerTemplate or if it is using the default links that it renders. I don´t know if these differences are normal, but I didn´t fi...

Enabel viewstate child control while parent control viewstate is disabled
   Hello,  I have a <asp:table EnableViewState="false"> control on my page, i have turned the viewstate off. In this table i have a cell where i put my custom contoll in, here i enable the viewstate of this control, <asp:TableCell ID="tdMainMiddle" runat="server" BorderColor="Black" BorderWidth=1px>       <cc1:Menu ID="Menu1" runat="server" EnableViewState="True"/> Is there a way to make this work, it seems that the viewstate property inherits from its parent, but can this be overruled?  Thanks in advance.   Nop...

Web resources about - Huge ViewState in GridView even when EnableViewState=False -

Resources last updated: 11/22/2015 4:35:08 AM