.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Truly Understanding View State

Posted By: Virendra Dugar     Posted Date: November 05, 2009    Points: 2   Category :ASP.Net
This article provides a detailed understanding of the ViewState.

View Complete Post

More Related Resource Links

SSRS 2008 R2 Problem understanding View State Validation steps

Hi, Sorry, but I have some problem understanding this steps. Please help me to understand this.  Pasted from http://technet.microsoft.com/en-us/library/cc281307.aspx?lc=1033 How to Configure View State Validation To run a scale-out deployment on an NLB cluster, you must configure view state validation so that users can view interactive HTML reports. You must do this for the report server and for Report Manager. View state validation is controlled by the ASP.NET. By default, view state validation is enabled and uses the identity of the Web service to perform the validation. However, in an NLB cluster scenario, there are multiple service instances and web service identities that run on different computers. Because the service identity varies for each node, you cannot rely on a single process identity to perform the validation. To work around this issue, you can generate an arbitrary validation key to support view state validation, and then manually configure each report server node to use the same key. You can use any randomly generated hexadecimal sequence. The validation algorithm (such as SHA1) determines how long the hexadecimal sequence must be. Generate a validation key and decryption key by using the autogenerate functionality provided by the .NET Framework. (Well, how to generate Validation key using .Net Framework?) In the end, you must have a singl

view state vs request parameters


If  the view state is the data entered into the form fields then they are supposed to be available in the request parameters or request body. Then why would we need view state for?


View State Encryption


Hi All,

Why is it that I see the same hash value generated when I use different algorithms for viewstate encryption. I have added below lines to the web.config file

<pages viewstateEncryptionMode="Always"

Security Briefs: View State Security


Effectively managing user state in web applications can be a tricky balancing act of performance, scalability, maintainability and security. The security consideration is especially evident when you're managing user state stored on the client. Here's what you need to know about view state security.

Bryan Sullivan

MSDN Magazine July 2010

Bugslayer: Measuring the Impact of View State


Bloated view state can be a real performance bottleneck for your Web app, but it can be difficult to diagnose. John Robbins creates a handy tool that records and reports the view state size for pages in your ASP.NET applications.

John Robbins

MSDN Magazine November 2007

C++ at Work: Persisting View State Update, Using Managed Extensions in a DLL


This month marks the 11th anniversary of my column and the inauguration of a new title: C++ At Work. We're also adding a new bimonthly column, "Pure C++," by my pal Stan Lippman, one of the great C++ Masters.

Paul DiLascia

MSDN Magazine February 2005

ASP.NET 2.0: Speed Up Your Site with the Improved View State in ASP.NET 2.0


View state is a wonderful thing. It allows the ASP.NET developer to maintain state for server-side controls that are not form elements.Used judiciously, it can improve the user experience. But in the wrong hands, it can cause your pages to grind to a halt. The release of ASP.NET 2.0 will include a variety of improvements to view state that will make it easier to use and less likely to slow performance.

Fritz Onion

MSDN Magazine October 2004

Cutting Edge: The ASP.NET View State


In ASP. NET pages, the view state represents the state of the page when it was last processed on the server. It's used to build a call context and retain values across two successive requests for the same page.

Dino Esposito

MSDN Magazine February 2003

i need clear idea and explanation about view state


can any one please explaine me about view state property, i need the basic thing, what is it actually, and why we use, wthat is the use of it. and etc etc plsssssssssssssss

Msg 102, Level 15, State 1 on view creation

Hi im trying to create a view from a table having the following value for: Each of the Id linking to another table,the user should be able to search for userid based on any criteria. UserId | UserRegionID |JobTypeID | CountryID | YrOfExp ------------------------------------------------------------- 53 27|20 23|36|24 204 16 54 29|20|33 25|24 172 5 55 22 36 204 3 The YrOfExp must be compared and the appropriate id stored in the view. Create view vwUserDetails as with vwUserDetails(userId,jobsID,RegionID,YrOfExpID) as ( select UserId, convert(xml,'<Job><JobId>'+ replace([UserJobTypeIDs],'|','</JobId><JobId>')+ '</JobId></Job>') as jobsID, convert(xml,'<Region><RegionId>'+ replace(Rtrim(Ltrim([UserRegionIDs])),'|','</RegionId> <RegionId>')+</RegionId></Region>') as RegionID, YrOfExpID = case UserYearsOfExperience when UserYearsOfExperience = null then null when UserYearsOfExperience between 0 and 1 then 29 when UserYearsOfExperience between 1 and 3 then 30 when UserYearsOfExperience between 3 and 5 then 31 when UserYearsOfExperience between 5 and 7 then 32 when UserYearsOfExperience between 7 and 9 then 33 when UserYearsOfExperience > 9 then 34 en

Resync designer view with model/view state

Hi, In most cases, changes made to the model or view state pretty much immediately reflect in the designer UI, assuming there is a corresponding UI representation for the model item or view state.  What I'm doing is using the view state to establish links (in a Flowchart designer) between activity designers.  Normally this works fine.  But occasionally, an exception is thrown saying that a connection cannot be made between two points.   In the event of this exception, I can wrap the statement that throws the exception (in my case, EditingScope.Complete) and retry the logic, this time not specifying the connection points and letting the designer's routing algorithm comes up with its own path.   The problem I'm experience is when I wrap the call (EditingScope.Complete) in a try/catch block that throws the exception and re-do the connection logic, this time not specifying the view state (but still specifying the Next property of a FlowStep, or True/False property of a FlowDecision, etc using the ModelItem.SetValue method), visually a connection is not made between the activities.  But if I manually close the designer and reload it or use the bread crumb navigation to move away from the current designer and then return, the connections visually appear. I want to be able to programmatically refresh the UI based on the updated model / view st

"view state" does't work for Image's ImageURL in dynamic controls


Hi all. in my page_load method I call a mthod that it create some dynamic controls. one of them is an Image control that it's ImageURL property set to an URL that is saved in data base. image shows that URL but when postback ocuurs, previous image controls doesn't their image. but other controls for example TextBoxes keep text values. what should I do for keep image url property for this dynamic Images controls?


view state doubled if i call prerender event


i have one method which save datatable in viewstate.

i am calling this method in

1. page_load

2. Prerender

the page was every heavy,

i did tracing of page i found due to calling of method from preprnder it doubled the viewstate size

what was the reseon behind this.

View State


What is the maximum size of view state?

Page - View State



I am confused about the View state in ASP.NET application. I was trying out something on a Web page, my observation was that the value which i entered on the text field on my ASP.NET web page persists after post back.

My assumption was that by default the EnableViewState is turned off for any web page. I put in the code Page.EnableViewState = False.

But still the value of the text entered in the text field persists after post back. Why is this?

Thanks in advance


What is the difference between view state and a hidden field


What is the difference between view state and a hidden field?

As we know that view state allows the the state of objects to be stored in hidden fields and is stored in client side. but what is the exact difffrence between a view state and a hidden field

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend