ViewState Enabled - False No Affect?

Sep 15, 2011

I have a Gridview that has some controls above you can use to select how much data the Gridview displays - a week's worth, a month's worth, a year's worth etc.

And, as it's a view only grid, I thought 'I'll keep the page size down by doing this:

<asp:GridView EnableViewState="false" etc.

But, if I look at a year's worth of data and look at Page Source - the ViewState is massive. If I look at a week's work, the ViewState is small. A month's worth - a bit bigger and so on.

So, despite setting EnableViewState to false - the ViewState does seem to grow in proportion to the data being displayed in the Grid. I don't need all that data held in ViewState so why is it happening?

View 17 Replies


Similar Messages:

Web Forms :: Tooltip Does Not Work On Firefox When Imagebutton.enabled=false?

Oct 27, 2010

I am not sure if I am posting this on the appropriate forum but I will give a try.

I have the following code:

[Code]....

[Code]....

[Code]....

View 6 Replies

Forms Data Controls :: Remove Row From GridView Without Using The E.Row.Enabled = False;

Mar 15, 2010

I need to remove certian rows from the Gridview so that certian users can't see certian rows. I have a row databoud event that checks for certian fields in the row and disables the entire row based on the value of those fields. However, it dosen't work well because if my gridview has 20 or 30 rows I have paging so if it disables all but 2 rows the user has to click in the pages of the entire gridview until they reach that row.

View 1 Replies

State Management :: Can't Change CSS Styles When Viewstate Is Enabled

Jan 5, 2011

I've inherited a project and in effort to beautify it, I'm replacing an image based menu bar with a CSS based bar. When you click on a button it takes you to the appropriate page.

Currently in the OnInit() it checks what page you're on and then changes the URL of the image for the appropriate button to be the "active" image for that button:

btnFacilities.ImageUrl = "menu_front_facilities.gif";

Pretty simple, and works fine, but it's a pain to add new items, because I need to create a new image and if I want to change the look, I have to create a whole new slew of buttons.

I have built out the CSS menu using basic UL and LI and all the hovers and links work fine. My issue comes when I want to set the "active" item. The way the CSS works is by either setting the CLASS of the active item to "active" or I could easily change it to set the ID of the item to "active", but in either case the viewstate crashes on any posts because the object is not the same as it was when the page loaded, since the style is updated when the OnInit(); event goes off.

I've tried both setting the class name:

menuFacilities.Attributes.Add("class", "active");
as well as directly applying the CSS style:
menuFacilities.Style.Add("background", "#1376c9 url('images/topnav_active.gif') repeat-x;");

Both work fine on the initial page load, but once I click anything that posts, it crashes with a viewstate failure.

If I set the enableviewstate="false" then it works fine between different page loads, but not if I post to the same page (ie submit a search form)

I can't figure out how to handle the "active" object. For some reason the image URL works for asp:Imagebuttons

Here's what one of the items in the menu looks like (pretty simple stuff here):

<li id="menuFacilities" runat="server" ><a href="#">Facilities</a>
<span id="submenuFacilities" runat="server" enableviewstate="false">

View 1 Replies

C# - ViewState Doesn't Work When Control Become Enable=False

May 26, 2010

Why when a control does contain value but it's set to .Enable=False that all controls become disable (that's ok) but why that the ViewState doesn't retain the data on the next post back? If I get the UserControl without modifing its Enable state, the ViewState work between post back.

How can we disable a UserControl that all its control become disable (this part work) but all of them KEEP use the ViewState (this doesn't work)?

Clarification:

1)In the aspx.cs click button EDIT:

myControl.Enabled = false;
//This produce to have all controls in myControl to be disabled.

2)In the asp.cs: click Save to leave the EDIT state:

myControl.Enabled = true;
//This produce that all controls inside myControl are blank : no viewstate!

Other postback works because we do not put myControl.Enable to false.

View 3 Replies

Web Forms :: EnableViewState False - Can Still Access And Maintain ViewState

Apr 21, 2014

If we set enable view state = false of a page then can we maintain the view state of that page ?

View 1 Replies

Web Forms :: What Can Remove All Info From Viewstate And Making The Ispostback Again To False

Apr 23, 2010

I have a strange problem, my webform is loading twice.

when i debug i see ispostback is showing false for both times.

what happened to the first time load , and the viewstate.

What can remove all info from viewstate and making the ispostback again to false.

i am having real difficulty figuring out what is causing this problem.

View 3 Replies

Web Forms :: W3C Compliant On Enabled="false" Controls?

Jul 6, 2010

I'm trying to make my website to be w3c compliant but I'm having a major drama with asp:RadioButton which have enabled="false" setup from the code behind. As some of you may know already, when enabled="false"; is set it will render the control with the additional <span disabled="disabled"> tag wrapping around the <input /> control.

Well the bad luck is according to w3c validator there is no attribute "disabled" for span. I tried using Attibutes.Add("disabled", "disabled") to disable the radiobuttons but it renders the same way.

I would like to register the website in a competition but it requires to be 100% fully w3c compliant =/

This is the last error that I can't solve... using the native html inputs is an option but is not feasible at this point in time.

I'm using .NET3.5 here.

Is there like a statement somewhere that I can lookup probably to reference this issue, maybe the judges in the competition would understand the situation if there is some kind of explanation.

View 6 Replies

Web Forms :: Disabled LinkButton Controls With Enabled="false" Still Render Onclick Event Handler

Jun 24, 2010

Disabled LinkButton controls with Enabled="false" still render onclick event handler

View 6 Replies

Control Initial Enabled State For Dependant Controls That Are Enabled / Disabled By JQuery?

Jan 3, 2010

So far, I've seen (and I'm using the following) scripts to show/hide a div or other controls depending on another control in ASP.NET

$('[id$=myRadio_0]').click(function() { $('[id$=myDiv]').show(); });
$('[id$=myRadio_1]').click(function() { $('[id$=myDiv]').hide(); });
and of course, my div in html like
<div id="myDiv" runat="server" visible="false">

and that works fine when the user selects either option of the radiobuttonlist. However, when I assign that radiobuttonlist a value of 1 or yes on my Page_Load on code behind, that isn't (and probably can't be) caught by jQuery, and my div remains invisible even though the control has a value of Yes/1. So, do I need to set the visibility of that div from code behind, or is there a way in jQuery to force a scan of these dependencies after i've set the values for the main controls in code behind?

View 1 Replies

State Management :: Failed To Load Viewstate. The Control Tree Into Which Viewstate Is Being Loaded Must Match ?

Oct 9, 2010

Now here is the weird thing. First i am running it locally on the built in vs2008 web server.I load my control in fine, do a postback from a linkbutton, locally on my machine it all works fine, no issue.However when it goes onto my host, it falls over with the message:

Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.Now i also load controls dynamically and use postbacks and things in the admin area of the site...and that works fine, however my front end just keeps failing? See the code behing below:

[Code]....

View 1 Replies

State Management :: ViewState And ObjectDataSource / Getting Values From Viewstate In GetTopThemes?

Jan 11, 2011

I have problem getting values from viewstate in GetTopThemes.

<asp:ObjectDataSource
ID="sourceGetTopThemes"
runat="server"
TypeName="DBConnection"
SelectMethod="GetTopThemes"
EnableViewState="true"></asp:ObjectDataSource>

[Code]....

}

[Code]....

when the page is not Posted back, I saved all values in the viewstate.

View 2 Replies

State Management :: ViewState - Does The Master Page Have Its Viewstate

Apr 30, 2010

I have been getting this error a lot lately with some of my users, and I had a couple of concerns with view state and I have read so many articles but I am still lost..

1. I use masterpage on all the pages and I need viewstate for some of the pages but..

There is a page where a user will fill out the information and then submit this data to a cgi server, and it is where I get most of the Client Disconnected errors, what would happen if I disable viewstate when they click on that button?

Now when a user browses from one page to another, does the view state from the previous page get deleted? If not how would I delete it?

Does the master page have its own viewstate? Would I be able to make sure none of items on my master page are using the viewstate?

View 7 Replies

C# - Page With ViewState Disabled Still Be Validating A Viewstate Field?

Sep 24, 2010

I have a shopping cart page (Cart.aspx) that has a button that will (sometimes) post to a third party payment gateway, if payment is necessary. The payment gateway will process the payment and then do a silent post to my website (Order.aspx) so I can update the order status.

Order.aspx always throws an invalid viewstate error, even though viewstate is disabled on the page.

What's happening is that Cart.aspx (which has viewstate enabled) posts to the payment gateway, and the gateway will post it back as part of the silent post. Even though Order.aspx has viewstate disabled and validation disabled, it still tries to validate the __viewstate field it's being given.

I know setting EnableViewState=false will disable the rendering of the __viewstate field, but if another page provides the field, shouldn't it still skip validation? I tried calling ViewState.Clear() on the Page_Init event of Order.aspx, but ViewState is apparently empty. how to get around this? I don't want to disable ViewState on Cart.aspx (in some cases it may be necessary), but I can't figure out how to clear it on Order.aspx.

View 1 Replies

Configuration :: Would This Affect Process Of Building

Jul 6, 2010

[Code]....

Would this affect process of building?


View 4 Replies

How Will The Ratification Of HTML5 Affect JSF, Struts

May 13, 2010

There is a lot of chatter about the improvements HTML5 is about to unleash on the web development world. How will this new standard affect web dev frameworks like Faces, Struts, or even ASP.NET? How long will it take them to 'catch up' in order to emit such code? Will controls get deprecated?

View 1 Replies

AJAX :: Affect Controls Outside The UpdatePanel?

Jun 4, 2010

I have a web page with an UpdatePanel containing two GridViews and related controls. There is a Save button on the page outside the UpdatePanel. One of the event handlers for a control inside the UpdatePanel calls a method DisplaySaveButton, which is supposed to make the Save button visible or not depending on a parameter. Although DisplaySaveButton is called & executed correctly, it does not effect the visibility of the Save button.

If I remove the UpdatePanel from the form, leaving all its content behind, everything works perfectly.

how do I affect the state of a control outside the UpdatePanel?

View 4 Replies

Web Forms :: Master Page Changes Affect Other Pages

May 27, 2010

I have had this problem for a long time now and have just dealt with it but i am at the point finally that i need a solution or i need to look at other options besides visual studio for web development. it is way too time consuming now to have to worry about changing one thing and then having to search all other pages to be sure they are still fine. So this is what i have: visual studio 2008 pro sp1 asp.net web application targeting .net framework 3.5

a master page with several tables. i have broken out into several tables because it seemed to help the issue. the tables are all stacked on top of each other, no special positioning. the tables seem to be fine for the most part but if i make changes to the table which contains the content placeholder, i will find other pages have formatting incorrect, such as backcolor of text in different areas changed, bulleted lists are overlapping. when navigating to some pages, one of the tables i have at the top that is not related to the table with the content placeholdder, will not show the background picture, and it will show either different font size of the menu that is in the table with the content placeholder, or bold font on other buttons text, such as link button, on the master page.

so they seem to affect each other. changes on the master page affect the other pages and when displaying the other pages, whether in a browser in the IDE, parts of the master page will be affected. this is only on certain pages and they are never consistent. they will stay consistent once changed, but each time i make a change to the master page, the pages which are affected are not consistent. However, it used to be a issue that was always consistent with certain pages i kept in their own folder. i had taken the time once to go through them and make fixes and after that i didn't really have any more issues. but now they are being affected again as well as others.

i had started using link buttons instead of hyperlinks because it seemed to not affect the other pages when formatting them. for instance i would highlight the backcolor of a link with yellow, and other pages text in random places would show with the same yellow backcolor. it does not seem to matter what any of the affected text is in whether in p or div, it doesn't seem to follow a pattern other than sometimes it does seem to favor text that is bold. i think in some ways it has to do with new content pages i add to the site. those seem to be the ones that are usually affected for sure. but there are always others and i never know for sure which ones they will be.

View 3 Replies

AJAX :: AnimationExtnender To Affect Only Hover Of Anchor?

May 25, 2010

I have a div and I only want to do a fade in when the div is hovered

[Code]....

Anyone have an idea how to direct the Animation Extender to only affect the div "tab_viewsummary" when hovered ( div:hover ) ?Style sheet section:

[Code]....

View 1 Replies

Do Web.config's Globalization Settings Affect Non-http Requests

Nov 15, 2010

In my ASP.NET application I set

<system.web><globalization culture="pl-PL" uiCulture="pl-PL" />

to have numbers and dates in this culture.

Surprisingly I noticed that methods invoked from job scheduler (Quartz library) use en-US? Why is that?

View 1 Replies

Security :: SQL Server DB Options Affect Use Of Login Control?

Aug 8, 2010

Why am I not able to login using my login control if I set the sql server database option for Recursive Triggers Enabled to "True"? Whenever I attempt to do so, I receive an error message on attempting to login that states "Your attempt to log in was not successful..."?

View 2 Replies

AJAX :: How Event That Occurs Every One Second Affect The Web Page Performance

Jun 23, 2010

I am using the timer inside UpdatePanel to check the time every second and enter it to a label control.

But I must ask, How this is going to effect performance? Bandwidth of the site?

View 6 Replies

Web Forms :: Size Of Folder Affect The Performance Of Application?

Mar 17, 2010

I am developing a site similar to forums. I allow users to Post articles and upload files regarding the articles. I am not storing the Attachments contents in DB instead i store only the path of the attachment file and store the actual file in physical folder in the Project directory. WHat i want to knw is if the size of the physical folder increase will it affect the performance of my application.

View 6 Replies

DataSource Controls :: Bad Sql Server Sessionstate Affect Other Databases?

Feb 4, 2010

We have a webfarm using a SQL Server 2000 database to store our session state.

On the same SQL server are our databases for the rest of the websites. The databases are separate but on the same server.

Recently I found that one of our developers is using the session very inefficiently. He is storing large datatables within the session for users when he could accomplish the same thing through other methods.

Can this inefficient use of the session state (when stored in SQL Server) affect the performance of our main database when they are on the same server?

The answer seems to be yes, to some degree. However, I cannot find any documentation to back me up.

View 3 Replies

Running IIS7 In Classic Mode Does Affect MVC Output Caching

Feb 25, 2010

I have a need to run an application in classic mode for backwards compatibility with a specific application, and am trying to understand what kind of impact that will have on the performance of an MVC application that is running on the site. If we put a few static file maps (for .js, .css, .png, etc) above the ASP.NET wildcard map to reduce the amount of processing by the ASP.NET handler, will we be approaching the integrated mode in terms of performance?

The thing i'm primarily concerned with is any effect this might have on output caching. I understand that integrated mode might (?) allow for the output cache to handle non ASP.NET content, but that isn't really a concern. We're more interested in ensuring that the MVC application has full use of the output cache. Empirically i've found that the two configurations operate on par when things go well, but if the page references resources that are not available, the integrated mode tends to fail much more quickly than the classic mode (e.g. 500 ms vs 10 seconds), reducing 'hang time' on the page load.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved