viewstate

How do I properly handle the viewstate of a child control within a composite control?

I have a composite control that contains a ListBox child control. On postback, the items for the ListBox disappear. I have a property for the ListBox that initializes it, and I add it to the controls collection in CreateChildControls. Am I doing something wrong? Do I need to be doing something else to properly handle the viewstate of thi...

Any viewstate implementation for JSP-Servlet app?

Do you know any implementation / technique which would provide similar behavior as Viewstate provides in ASP.NET. (Serializing the data into hidden field within the HTML form). I am using only JSP, Servlet, and Spring MVC. ...

Enable ViewState for few controls and disable for others/page

When I disable ViewState for the page. It does not allow any other control to use ViewState .. even if I set EnableViewState="true" for that particular control .. is it possible to enable ViewState for a control when ViewState is disabled for the page itself? if not how can disable viewstate for controls on page except for few without ...

Problem with dynamic controls in .NET

Problem with dynamic controls Hello all, I'm wanting to create some dynamic controls, and have them persist their viewstate across page loads. Easy enough, right? All I have to do is re-create the controls upon each page load, using the same IDs. HOWEVER, here's the catch - in my PreRender event, I'm wanting to clear the controls co...

Getting SelectedItem of a DropDownList and retaining list items

Ok Here's the issue.. I have small page which has label, dropdownlist and a submit button. <div> <asp:label id="Message" runat="server"/> <br /> Which city do you wish to look at on hotels for?<br /><br /> <asp:dropdownlist id="Dropdownlist1" runat="server" EnableViewState="true"> </asp:dropdownlist...

ASP.NET Masterpages and viewstate

I am looking to improve the performance of my site, not because it is performing badly but just as a general exercise. The usual suggestion for asp.net sites is to remove viewstate wherever possible. I believe this can be done by each control on a page separately or for the whole page. My question is if I disable the page viewstate will...

Why is my asp:TreeView selected node reset when in an UpdatePanel?

I have an asp.net 2.0 page that contains 2 UpdatePanels. The first panel contains a TreeView control, when I select a node in the three view control it triggers an update of the second UpdatePanel only. This much is behaving correctly. There are two buttons on the page outside of an update panel (previous/next). These buttons trigger a...

What is the best method for storing viewstate in an ASP.Net mobile web application?

I'm curious what techniques you find to be the best for storage and maintaining of viewstate with respect to an ASP.Net application running within a mobile web browser (i.e. Treo with Windows Mobile, or Blackberry Curve web browser). ...

ViewState error points in site.master

Hi, I just added asp.net calendar control in new page under sample folder in asp.net mvc beta application. when i execute the particaular page that i need and it shows the error following Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validation...

Postback not working with ASP.NET Routing (Validation of viewstate MAC failed)

Hi. I'm using the ASP.NET 3.5 SP1 System.Web.Routing with classic WebForms, as described in http://chriscavanagh.wordpress.com/2008/04/25/systemwebrouting-with-webforms-sample/ All works fine, I have custom SEO urls and even the postback works. But there is a case where the postback always fails and I get a: Validation of viewstate MAC...

Does viewstate expire?

Let's say you have a aspx page that does not rely on session, but does rely on viewstate for persistance between postbacks. If a user is accessing this page, and leaves for a long lunch, will viewstate still be valid when he returns? ...

What's the best way to send a lot of checkboxes to the client in ASP.Net?

I have the following situation: A user will define a certain filter on a page, and on postback I will query the database using that filter and return a bunch of matching records to the user, each with a checkbox next to it, so he can choose whether to act on each of those records. In Classic ASP / PHP I can generate a lot of controls n...

Raise OnMenuItemClick without ViewState?

I have a (derived) Menu control, that displays a rather large list of items from a custom data source. I need to disable ViewState on the menu to avoid the very annoying "Can't select a disabled or unselectable menu item" when some other control causes the current selection to change on a postback. Unfortunately, when ViewState is disab...

MS Reportviewer - Save Expanded/Collapsed Nodes in ViewState?

I have a report that's being populated from an ObjectDataSource. The report includes expandable/collapsable nodes per user. I'm allowing the viewer to filter the report by setting the FilterExpression on the datasource, then calling ReportViewer1.LocalReport.Refresh(). This is done during PostBack. This filters the results, but the...

Sensitive data in Viewstate?

I need to store sensitive data across few pages (run over https) per session. I can't use session object, for the primary reason being that the session store is designed as just as backup store (primarily make service calls and load the session). If the session has been restarted or in other words that the key in the session does not ex...

Ideas for how to deal with viewstate when using ASP.NET AJAX and update panels

Here is a class that I wrote to solve some issues that I was having with viewstate. It stores the info in the users session and increments a value to track which state to show. The difficulty is that there is no support for the back button. The reason I originally had this was that before AJAX came along the viewstate was being send d...

Why does __VIEWSTATE hidden field gets rendered even when I have the EnableViewState set to false

I saw that __VIEWSTATE field gets rendered even though I have set the EnableViewState="false" at the page level. This field is not rendered if I remove runat="server" tag for the form element. Can somebody please explain this? ...

loadtesting asp.net site (postbacks/viewstate)

what is the best way to loadtest an application that relies heavily on posts with viewstate (same posts can't be sent twice, so a simple record / replay won't do) Can I generate the viewstate to be used in in the posts? ...

Inconsistencies with viewstate/function/server vs development server.

Hi, The code goes something like this: protected bool IsOKToSend() { bool IsOK = true; lblErrorSending.Visible = false; if (txtUserName.Text == "" ) { lblErrorSending.Text = "Please enter your username before sending."; IsOK = false; } return IsOK; } protected void btnSubmit_Click(object sender, ...

ASP.NET 2.0: How to make a page remember viewstate without creating history points?

I have a page with a few fields and a runtime-generated image on it. The contents of this page are inside an UpdatePanel. There is a button to take the user to a secondary page, which has a button that calls javascript:history.go(-1) when clicked. The problem is, the first page does a full request instead of a postback or just using the...