viewstate

ASP.Net MVC - Viewstate validation failed on page with no viewstate (or server side controls)

An interesting take on an error that's really fustrating. I have a MVC page with no runat=server controls, a single form, and yet I have still recieved a "Validation of viewstate MAC failed" exception on the page, when reading through my error logs. Here is the exception thrown: System.Web.HttpException: Validation of viewstate MAC fa...

save Load User Control Dynamic to viewstate

Hi, i add user control dynamcly to the page and trying to save to viewstate when i triyed to save the placeholder to the view state i got this error " PlaceHolder is not mark as serializable." here is my code Controls_PriceControl ctrl = (Controls_PriceControl)LoadControl("../Controls/PriceControl.ascx"); plcPrices.Controls...

Where to store temporary data in an ASP.NET application.

In my web application I have a number of custom grids on a page. I want the user to be able to edit data in each grid and then press save once at the end of the process to commit their changes. So I need somewhere temporary to persist their changes before they are comitted. The grids will use AJAX/Javascript so as to not force a full pa...

Listbox items client side reordering not reflected in server side (ASP.NET)

I reordered some items in a listbox using Javascript. When I read the items in a postback in the code behind (ASP.NET), the order is in the original order. How do I get the same order as shown in the screen after Javascript manipulation? ...

Gridview loses its viewstate

Hi, In a page, i put a gridview with several template field columns. In one of the template field, i have a linkbutton. Before postback i bind the grid with data. Once page loads, when i click the linkbutton in gridview, it is not firing the related event and its return a empty aspx page. ...

invalid viewstate error - OnPreRender

I'm getting 100+ errors per day on my website with System.Web.HttpException: Invalid viewstate. The website is asp.net 3.5 running on iis6 , not running in a web-garden/web-farm , single server. Here are a few sample errors. Machine: ML Framework Version: 2.0.50727.3603 Assembly Version: 6.5.3664.33889 Source: http://www.domain.com/...

Storing IDs between pages for up to a day?

I need to store IDs (Contact IDs, Claim IDs, etc.) between multiple .aspx pages. At the moment I am storing the ID in the Session and have set the Session timeout to 300 minutes. However, I am still getting errors because users are attempting to perform operations after the Session has expired. I think users are leaving their web bros...

ASP.NET MVC : Create an ambient value.

I have a simple web-site. Almost every action takes int toonId as an argument (toonId does not equate to the user: one user can own multiple toons). At the moment I provide that value to every view from controller, and every link and submit button sends this value back to the controller. This works. I am just looking for an easier way to...

How to disable viewstate on GridView and get grid view values on postback

I have a GridView control with one editable column (with input text box in it bound to domain object). The ViewState is getting large for this control and I want to disable it. But, with ViewState disabled, GridView refuses to update bound values. It's pretty obvious, that GridView can't restore all it's controls before LoadPostData get...

ASP.NET app having viewstate corrupted every few minutes

I'm having a problem with a web app I'm managing. Users starting receiving the following error occasionally: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a clu...

Asp.net Invalid viewstate - Maybe IE8 4k dropped bug??

I'm getting 100+ errors per day on my website with System.Web.HttpException: Invalid viewstate. at System.Web.UI.Page.DecryptStringWithIV The website is asp.net 3.5 running on iis6 , not running in a web-garden/web-farm , single server. The website is using xhtml doctype. viewstate size vary from 2kb-20kb Here are a few sample errors...

viewstate in reporting services

I work as a consultant at a company that have around 30 reports in a reporting services 2005 server. All of the reports use around 10 parameters to change the data loaded into the report. The parameters is depending on eachother also. The problem is that the reports causes long loadtimes for booth changing parameter and processing/loadi...

Manage view state with multiple combined REST resources

Say for example I would write a forum which would look like this in the browser: - original post - Re: original post - Re^2: original post - Re^2: original post + Re: original post _______________________________________________________________________________ Text of the selected post. The tree view would be one resourc...

Validation of viewstate MAC failed

Ran into this issue yesterday on one of our sites. First of all the site is hosted in a web farm environment and for the time being I have added a static machineKey to the web.config on both nodes (2 node environment). This has solved the issue and everything is running fine now. This raised the following question: Why is it that all...

Remove System.Web.UI.IndexedStrings in ViewState to reduce its size?

While trying to reduce my Viewstate's size, I found that there are a lot of System.Web.UI.IndexedStrings (~10KB) in it. I'm not sure if I fully understand the mechanism but is it a good idea to keep those instances and if yes, why? And which approach would you take to remove them? ...

Rebinding a list of textboxes in ASP MVC2 VS2010 Beta2 after postback

So.. I have a problem. I'm sure almost anybody that tried MVC has had it. Nevertheless I've been unsuccessfull in googling a solution or thinking of one for my self. The problem is this: I have a list of textboxes that I'd like to edit all at once, and I'd also like to add new items to my list. However, the text binding fails after the ...

Dataset manually put into the viewstate of a Web UserControl not kept after postback

I've created a Web User Control that is placed on the page at design time. It's purpose is to pop up with a grid of items the user is to choose from. So I've got a gridview on it. And this code in the usercontrol: Public Property DataTable() As Data.DataTable Get If Not IsNothing(ViewState("_SelectGridDataTable")) The...

Retaining viewstate in textboxes found in a dynamically created table

Hello Guys! My problem is that I have an ASPX page which contains an ASP:Table. The rows for the table is added dynamically on Page_Load. One column in the table contains TextBoxes, BUT when I type something on a TextBox and cause a postback, I am unable to find the value just entered. And above that the table is not displayed after the ...

Reasons why viewstate validation fails (but only sometimes)

The following message appears in our log: The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls ad...

Getting the old value of a asp.net control on postback

I want to be able to find the old value of a asp.net control (textbox, checkbox etc) without relying on events (e.g. OnTextChange event). Something like "someTextboxControl.OldText" would be perfect! I imagine that it is stored in the viewstate and need to somehow get at it via a custom control. Any ideas? ...