viewstate

Why is my view state not storing a dynamic control adding using Controls.Add?

I'm trying to load a control depending on a category ID that is selected from a drop down list. This is this code i have within a switch statement to show a usercontrol. This was the only way i knew of doing it and having reusable views. I'm open to other methods as i've read a few people saying to avoid dynamic loading? var control = ...

ASP.Net viewstate questions on form postbacks

Let's assume I have a very simple form, with a submit button and a dropdown list. When I change the list entry and hit submit, at what stage in the postback processing does the viewstate reflect my changed list entry? According to O'Reilly's Learning ASP.Net 3.5, there are two loads taking place-- one before form validation and another...

How ASP.NET MVC removes ViewState from application?

I'm looking in ASP.NET MVC source and don't found where ViewState is removed from application. (The ViewState is not just disabled, it is removed of all pages in application) Thanks! Update: Is remove Viewstate hidden field possible? ...

Asp.net MVC with ViewState?

Just read blog post of Maarten Balliauw. Wanted to ask will <%Html.Serialize("person", Model); %> return bunch of 'don`t-stop-debugging-heavily-server-sided' RAD controls? Is that's a good idea to include this? If so - what kind of usage would be appropriate? ...

Dynamic Controls Created from Database Data

Hi, I have been working for a couple days trying to figure out how to do this. Working in C# I have a List of data being pulled from various database tables. I want to create different DropDownLists from this data that will persist across PostBacks. One way I was able to tinker through this was to parse the data into List> and nest t...

asp.net server side viewstate without sessions

So I've done my best to minimize my viewstate on my ASP.net ajax application, http compression, disabling viewstate in hidden fields, but would like to go further. So after researching it seems that there are two approaches a) use the ASP.net 1.x way which uses LoadPageStateFromPersistenceMedium b) or use the ASP.net 2.x way SessionPa...

Problems reloading the viewstate of my dynamically created ASP.Net controls.

I have an ajax toolkit tab container on my ASP.Net page, and I am dynamically creating the tabs in the code behind (at runtime, I have a variable number of tabs, each with the same layout but different header text and body data). Each tab contains only one control, which is a user control I built to make all the tabs look the same. In ...

How to minimize viewstate size of a page in asp.net?

Hi all, How to minimize viewstate size of a page in asp.net? Please help. ...

Viewstate in flat files vs viewstate in SQLserver

I wrote my own PageStatePersister class based on SessionPageStatePersister which writes the most recent 10 Viewstates for a session to a shared disk. I figure this will scale better than  keeping Viewstate in session since all web servers have access to it, they won't have to deal with expiration, and use less memory. When a user close...

Deleting GridView’s rows

Hi Let’s assume that ( the first time page is created ) I manually bind GridView to some data source. Is there’s a way to configure GridView to delete a row ( by pressing row’s delete button) without handling any of the delete events ( in other words, we wouldn’t try to delete a row in data source and then rebind GridView to it)? Inst...

Maintaining usercontrol state on dynamically added usercontrols

I have a page that dynamically creates multiple usercontrols on the page_init event, and adds it to a placeholder on the page. The usercontrols themselves databind to a repeater on page_init to a collection of about 10 strings, which outputs a div for each item. There's also a "view more" link button on the user control. When I click ...

ViewState and Security Settings generating errors

I have an odd reoccurring error that I believe is related to View State and security settings. This error appears on one of my client’s site between 1 to 6 times a day: Source: System.Web Error in: /detail.aspx?CaseID=1852 Error Message: Unable to validate data. Stack Trace: at System.Web.Configuration.MachineKeySection.EncryptOrDecr...

Is there a way to expire the viewstate ?

Hi All, I want to know is there any way to expire the viewstate after a particuler given time. ...

asp.net Invalid character in a Base-64 string

...

Accessing the viewstate of a child control.

I want to extract information in the viewstate of a child control. This control belongs to a third party and i do not have access to the source code. Is this possible? ...

Asp.net dynamic table content is removed when saved in Viewstate

Set content of table ... ViewState["Table1"] = Table1; // When remove this line, table is seen on the page. ... What should I do, urgent please. ...

Which is best to use ViewState or hiddenfield

Hi All, I have a page in which I want to maintain the value of object between post backs. I am thinking of two ways to maintain the value of objects Store the value in View Sate Store the value in hidden field which is best option to use based on performance ...

ViewState error: Concurrent users modifying dynamic controls.

Have a page that adds controls dynamically. Control state is being retrieved from database and controls are re-added to page on postback. User can add/delete controls through UI. When two users are on the same page and one adds/removes controls the other user will get ViewState error next time he tries to modify control state. "Failed ...

Can a datareader be stored in a viewstate?

Hi all, Can a datareader be stored in a viewstate? What data can be stored in viewstate? ...

Resolving viewstate/namespace conflicts

Hi, I have a listbox control. When the user clicks it, it tells a custom control to use a certain ID to use. The custom control draws the same thing everytime(dynamically), just loads different content depending on this ID(it's loaded from a database into a dynamic form like control). Ok, Now I'm having trouble with viewstate spillage....