Vous êtes sur la page 1sur 19

11/22/11

ASP.NET State Management: Vie

State
Sea ch

ASP.NET with emphasis on web standards

Home

Blog

Articles

Projects

Tools

Podcasts

About

ASP.NET State Management: Vie State


Posted on March 14, 2004 | Download sample code 90 comments

ASP.NET view state is a great feature and an essential tool for web development of toda . It maintains the state of a page as it travels back and forth. There is no more need to worr about restoring values of page controls between postbacks. In this article ou will get an in-depth perspective on view state. We will talk about wa s of reducing unnecessar pa load and protecting view state from pr ing e es. Among IT professionals it has become popular to debunk, dissect, expose, and unleash things. In this article we will first debunk view state, and then dissect it. No, first unleash then debunk. I think.

Dissecting Vie State


As far as web developers are concerned, the web is stateless. This statement will serve as the cornerstone of our entire discussion of view state. Therefore I ll say it againas far as we are concerned, the Web is stateless. For example, you request an ASP.NET page from a web server. Once the page is processed on the server and returned to you that same server does not remember the page anymore. Even a slight page postback initiates the same request sequence and the web server performs the same task again as if it never saw this page in the first place. This is the grand difference between web applications and their desktop counterparts. On the desktop you can maintain state between requests. On the web it s a much harder task. How do you retain text in input boxes, selections of dropdown controls, etc? To maintain state on the web you need help. ASP.NET goes a long way giving you the necessary support to carry on the page state from one request to another, and it does so seamlessly. Sometimes so seamlessly that you may overlook a large chuck of text you drag around. Hold this thought. We'll get back to it shortly. To summarize view state's mission in once sentenceview state helps you maintain values through subsequent requests of the same (!) page.

Where Is Vie State Stored?


View state is simply text. It is an aggregate of values of controls on a page. It's a string that contains values of page controls hashed and encoded in some manner. The view state contains no information about the server or the client. It only comprises information about the page itself and its controls. It lives along with the page in the user's browser. As a rule, view state is stored right in the page and therefore it travels with it back and forth. Remember good old hidden input fields? View state is nothing more than a hidden input which holds a hash of control values. If you view the source of an ASP.NET web form you will see something like this: <nu tp=hde"nm=_VESAE ipt e"idn ae"_IWTT" vle"E au=Cb Em +cIFngL/B0.> nm B8DlpCJH0.. Nobody in sane mind can read these strings fluently. What you see here is a base64 e c ded

string. I emphasize e c ded because some folks assume view state is encrypted. Base64 is not an encryption algorithm. Base64 makes a string suitable for HTTP transfer plus it makes it a little hard to read. Just a little. It's easy to decode this string and see what's inside. Can this be a security issue? It sure can. We'll address your concern in due time. Stick around.

Ho Is Vie State Built?


Every server control ultimately derives from the C n r lclass. Be it a W b o t o , H m C n r lor oto eCnrl tloto

aspnetresources.com/articles/Vie State

1/19

11/22/11

ASP.NET State Management: Vie

State

even L t r l o t o it has a property called E a l V e S a e When a page is built every control ieaCnrl nbei tt. that has this property enabled contributes to the view state by seriali ing its contents (in this case: converting its contents into a string). Now, some controls are easy to serialize, while others might give us grief. What manages the view state is the StateBag class . This class is like a dictionary you may store key/value pairs in it. This is how you store a piece of useful data in the view state: VeSae[SrOdr]="mi" i tt "otre" eal When the page posts back its view state is taken apart (decoded) on the server and each control participating in the view state gets its value restored. There's an interesting gotcha you need to be aware of. Some controls get their values restored automatically (courtesy of ASP.NET) and you don't need to maintain their values! I put together two almost identical pages one is an ASP.NET web form, and the other one is plain HTML. The ASP.NET page has its view state turned off completely. See how it maintains text and selections once you click Submit. Scroll down to "Form Collection" to see what was posted. ASP.NET restored these values automatically!

The second page is old, "traditional", HTML. Click Submit to receive proof that control values won't be restored. What's the moral of this story? You don't always need view state enabled to maintain page state. "When d I need it though? What's it for then?" Glad you asked. The prime candidates for participation in view state are those controls that don't post back with the HTTP form a d controls added or populated dynamically. Let me give you an example. Suppose you have an empty dropdown list which you populate with user names from the database. When the page runs for the first time (! a e I P s b c . Rings a Pg.sotak bell?) you need to databind it and fill it with user names. What happens once the page loads? Without view state the dropdown list will be empty. As you enable view state the dropdown list content will be restored on postback. Or... you would have to populate the list from the database every time the page posts back! If you weigh database access vs. view state the scale tips in favor of view state (unless the list of users is so huge that you'd rather ping the database each time instead of dragging around a giant view state string).

What E actl Can I Store in Vie State?


Documentation states the view state is "optimized" for a small number of types. The lucky ones are strings, integers, booleans, ArrayLists and HashTables. Everything else should either be serializable or have a TypeConverter defined for it. Beware of performance drawbacks for complex types. Serializing and deserializing a complex object could incur too much overhead. Choose wisely! Consider storing such an object in Session or Cache instead. Remember whatever you store in the view state travels back and forth wasting bandwidth and making page downloads slower. Susan Warren has kindly put together this decision chart of view state vs. session: Session State
Holds server resources? Times out? Yes Yes after 20

View State
No

minutes (default)

No No, limited support for: strings, integers, Booleans, arrays, ArrayList, hashtable, custom TypeC onverters

Stores any .NET type?

Yes

aspnetresources.com/articles/Vie State

2/19

11/22/11
Increases "HTML payload"? No

ASP.NET State Management: Vie


Yes

State

As you see some objects are a perfect fit for view state, while others had better be stored in the session. If you still need to store an object in the view state think about creating a T p C n e t r eovre for it to improve performance.

How Do I Enable View State?


You may do so on the machine, application, page and control level. First, you must have a server side form (< o m r n t " e v r > By default view state is enabled (as of ASP.NET 1.1). A quick f r u a = s r e " ). peek into m c i e c n i reveals this much: ahn.ofg <ae ealVeSae"re ealVeSaea=tu"../ pgs nbei tt=tu" nbeiwttMc"re . > The nature of m c i e c n i prescribes general settings for all applications. In other words since ahn.ofg view state is enabled on the machine level it is enabled on the application, page and control level. Thus each server control has view state enabled by default. Settings roll downhill so to say.

How Do I Disable View State?


Again, you may do so on the machine, application, page and control level. To disable view state of an individual control set its E a l V e S a eto false: nbeiwtt <s:ae i=ae1rnt"evr EalVeSae"as"/ apLbl dLbl ua=sre" nbeiwtt=fle > As a rule of thumb if a control does not contain an d namic data, or its value is hardcoded or assigned on ever page request and ou're not handling its events ou can disable the control's view state. A good example of a big consumer of view state is the DataGrid control. Should you enable its view state or not? It depends. Again, if the page with the DataGrid does not post back you can live without view state just fine. On the other hand, if the DataGrid has sorting or paging enabled you will want view state. Remember, DataGrid renders as a table with rows and cells being its child controls. View state is maintained for these child controls. The DataGrid has no memory of the datasource you bound it to! The datasource is NO stored in the viewstate.

You may also disable view state on an entire page by modifying the Page directive: <@Pg ..EalVeSae"as"% % ae . nbeiwtt=fle > If you really wish you may also disable view state on the whole web application by adding the following line to your w b c n i : e.ofg <ae ealVeSae"as"/ pgs nbeiwtt=fle >

When In Page Lifec cle Is It Safe To Use View State?


In the page lifetime cycle view state is available between the I i and P e e d revents. If you nt rRne need to dig deeper into the class behind the view state check out StateBag and StateItem .

Can I Get Rid Of View State Completel ?


No. You will always have a relatively short string representing the page itself even if you turn off the view state on each and every control.

Si e Matters
Spammers know better. By trimming the view state where you can live without it you do yourself and others a favor by reducing payload and improving page performance. Just recently we were cleaning up dead view state in our main product at work. I was shocked how much lighter most pages have become. A couple of pages that didn't post back had large databound controls. B disabling view state on one of them the si e of the view state went from 28K to 20 b tes! Quoting a 1400% reduction would be ridiculous but you get the point. The whole exercise proved to be well worth it. You need to thoroughly understand what each page does before you trim its view state.

Adressing Securit Issues


I started my career as a hacker (A note to Big Brother: there's nothing interesting here. Go away). My first languages where Pascal (oh yes, Borland was beating Microsoft back then), Assembler and then C++ (another score for Borland and Zortech). I can tell you right up front if something can be

aspnetresources.com/articles/Vie State

engineered, it can as well be reverse engineered. Not that all "security consultants" out there

3/19

11/22/11

ASP.NET State Management: Vie

State

e gi ee ed, i ca a e be e e e e gi ee ed. N ha a " ec i c c ... S i , Mic f f i hei i fi i e i d ga e ec a e i a e - e i a . A d ea e e e ha P I i h he ad i gi The g d hi g i e e .N ca a A ea ia ie i e a e. Y ha he " ha ed ec e " i c ie ha e ii e i f ca ha ic ie bac ed a i .

a " he e ie a e a ea ff he e e ca e. i g g ha d .

he e e a a f i ea i he

Protecting View State: The Eas Wa


O ce agai , ie a e i e e e ed a a ba e64-e c ded i g. The e d he e i e c ded. N e c ed. The ef e if e e dec f a eb age. Ma be e e d be a e! Thi a ea ha e e a b ( e-c ic a ac ) h f i gi be ie e i ' effec i e a c e hi a ac . de i d be ab e gai i igh f he i g a e gh e a c edi ca d be i ie i d hei age, e-fi i a d e d i e e dea i g i h a egi i a e age. The e' a i e e

B defa ASP.NET b i d a -ca ed Me age A hen ica ion Code (MAC) a d a e d i a e. Whe he age bac ASP.NET eca c a e he ha h a d c a e i he a i ed i h he ie a e i g. If he a e diffe e i e e dc a e . If i m c i e c n i agai ahn.ofg ' ice ha MAC a ida i i b defa : <ae ..ealVeSaea=tu"/ pgs . nbeiwttMc"re > I i g e e a ida i d be a id a T h a ec e ded ha ee MAC a ida i e ab ed a a i e . I fi g a ac , i.e. he a a ac e feed a e ha a d e ' e ih e-c ic a ac , h gh, beca e he ie d he age i e ec e de he ec i c e f he e . e-c ic a ac ef e ID, f a i ca e a he i e ech i

he ie e ha ee

' a a e

e . Thi i a ea

e. I ASP.NET 1.1 he P g ae e i e a e

ca ha a e (a he ica ed N a e: Thi i ac i .

e , Vie S a eU e Ke e a e). e if e b e a

. Se i i Page_I i

a dd

'

a ici a e i

ii e

B defa

ASP.NET c ea e MAC

i g he SHA1 ha hi g a g

ih :

<ahnK ..vldto=SA"> mciee . aiain"H1/ If i h a i c i e MD5 i ead. SHA1 p od ce a la ge ha h han MD5 and i he efo e con ide ed mo e ec e. Kee i i d, h gh, ha he ie a e i g ca i be ba e64-dec ded a d ie ed he c ie .

Protecting View State: The Hard Wa


I ' ea ha ha d. Y ca g e . Thi i a e ce : 1. Se e a l V e S a e " r e nbeiwtt=tu" 2. Se m c i e e ahnK Y wbcni h e.ofg a ida i e 3DES. Thi ca e ie : e ASP.NET e c he ie a e. be dc a i g ie a e ha he a d ha e i e c ed a

d ha e he e

<ae ealVeSae"re ealVeSaea=tu"/ pgs nbeiwtt=tu" nbeiwttMc"re > <ahnK ..vldto=3E"/ mciee . aiain"DS > Si e a ha . He e' ha ha e behi d he c e : ASP.NET c ea e a a d a d e i i each e e ' L ca Sec i A h i (LSA). The ef e i bec e i ib e dec he ie a e i g i ce he " ha ed ec e " i ed ASP.NET e he e f LSA e c a d dec he ie a e. e c i a he e i e . e

Protecting View State: Web Farm Scenario


B defa ASP.NET e a a d dec i ha e e i each e e ' SLA. Wha faci i a e a ie a e ha e e i be diffe e ( e The a i wbcni: e.ofg c ea e b ge e a ed e f ie a e a ida i a de c i a a e a d he ef e diffe e e a e e ed. B ha e if eb a ica i i a eb fa ? H ca e f a he e e ? Ob i he e f e f e be , he a e ge e a ed a a ica a d he ef e a h he a ida i a d dec i e b ha d a d . Va ida i h e e ide d hi he e i e?). i

e he

aspnetresources.com/articles/Vie State

4/19

11/22/11
<ahnKy mciee vldtoKy"au,Ioaeps" aiaine=vle[sltAp] dcytoKy"au,Ioaeps" erpine=vle[sltAp] vldto=SA M53E"/ aiain"H1 D DS > Let's take a closer look at m c i e e attributes: ahnKy

ASP.NET State Management: Vie

State

1. v l d t o K yspecifies the key for validation of the view state. ASP.NET will use this key aiaine when calculating MACs. The key must be 20 to 64 bytes (40 to 128 hexadecimal characters). The recommended key length is 64 bytes. This key should be generated in a random manner. If you tag I o a e p sto the end of the key value ASP.NET will generate a unique key for sltAp each application using the application's ID. 2. d c y t o K yspecifies the key used to encrypt and decrypt the view state when erpine v l d t o = 3 E " They key must be 8 for DES encryption or 24 bytes for 3DES (16 or 48 aiain"DS. hexadecimal characters respectively). The recommended key length is 48 bytes. This key should be generated in a random manner. If you tag I o a e p sto the end of the key value sltAp ASP.NET will generate a unique key for each application using the application's ID. 3. v l d t o sets the type of encryption. When set to SHA1 or MD5 it instructs ASP.NET to use aiain either SHA1 or MD5 algorithm to create view state MACs. When set to 3DES instructs ASP.NET to encrypt the view state (also provides integrity checking) with the help of the Triple-DES symmetric encryption algorithm. For your convenience I've put together an online machineKey Generator complete m c i e e that you can paste in your w b c n i . ahnKy e.ofg If you still have doubts that view state can be very secure read on the database. . The tool creates a

you'll learn how to store it in

Keeping Vie State On The Ser er


The good old P g class allows us to tap into the process of storing and loading view state. With ae the technique you can reroute the view state to a database. Why would you want to? Maybe you manipulate a lot of dynamic data and your view state is till big aggravating matters for users with slow internet connections. Or maybe you are still concerned that someone decrypts the view state in spite of all these tight security measures. You are free to use this technique. After all, the page is only the view state's default persistence media. The Page class gives us the right tools for the job. It provides two handy virtual methods: poetdvrul rtce ita vi SvPgSaeoessecMdu(betveSae; od aeaettTPritneeimojc iwtt) poetdvrul rtce ita ojc LaPgSaermessecMdu(; bet odaettFoPritneeim) You can easily guess from their names that these two methods persist view state to and load from a medium. This medium can be just about anything a file, a database, etc. At the beginning of this article I explained the role of the S a e a class. I also said that the view ttBg state is represented as a textual string. How does the conversion happen? There's hope. It lies with the class called L s o m t e . oFratr These days MSDN states that L s o m t e oFratr "serializes the view state for a Web Forms page" and "is designed for highly compact ASCII format serialization. This class supports serializing any object graph, but is optimized for those containing strings, arrays, and hashtables. It offers second order optimization for many of the .NET primitive types."

Good enough. L s r m t e lists two methods we're after: oFoatr pbi vi SraieSra,ojc) ulc od eilz(tem bet; pbi vi SraieTxWie,ojc) ulc od eilz(etrtr bet; and pbi ojc DsraieSra) ulc bet eeilz(tem; pbi ojc Dsraiesrn) ulc bet eeilz(tig; pbi ojc DsraieTxRae) ulc bet eeilz(etedr; The S r a i emethod is the one that converts an instance of S a e a (second parameter) and eilz ttBg writes it into a S r a or T x W i e . The D s r a i emethod performs the opposite task. It builds tem etrtr eeilz

aspnetresources.com/articles/Vie State

an instance of S a e a from a base64 encoded string, a stream or a T x R a e . ttBg etedr

5/19

11/22/11

ASP.NET State Management: Vie

State

an instance of S a e a from a base64 encoded string, a stream or a T x R a e . ttBg etedr Some code is in order to illustrate the mechanics of view state persistence: poetdoerd rtce vrie SvPgSaeoessecMdu (betVeSae aeaettTPritneeim ojc iwtt) { SrnBidrs =nwSrnBidr(; tigule b e tigule ) SrnWie sr=nwSrnWie (b; tigrtr w e tigrtr s) Lsomte fratr=nwLsomte (; oFratr omte e oFratr ) fratrSraie(w,veSae; omte.eilz sr iwtt) srCoe(; w.ls ) / Soetetxulrpeetto o VeSaei te / tr h eta ersnain f iwtt n h / dtbs o eswee / aaae r lehr / Tesraie ve saei aalbevas.otig( / h eilzd iw tt s vial i bTSrn )

poetdoerd ojc LaPgSaermessecMdu( rtce vrie bet odaettFoPritneeim) { ojc ojiwtt; bet bVeSae srn sriwtt; tig tVeSae / Vesaesol b ra fo tedtbs o / iwtt hud e ed rm h aaae r / esweeit sriwtt / lehr no tVeSae Lsomte fratr=nwLsomte (; oFratr omte e oFratr ) ty r { ojiwtt =fratrDsraie(tVeSae; bVeSae omte.eeilz sriwtt) cth ac { trwnwHtEcpin(Ivldvesae) ho e tpxeto "nai iwtt"; rtr ojiwtt; eun bVeSae

Feel free to download a full-fledged sample of this code.

Burning View State Fat


Reflecting on our experience of our flagship product at work, I'd like to share a little "success story". We decided to give the code above a try and redirected view state persistence to the database. Next we ran stress tests in Microsoft Application Center Test (ACT) which comes for free with Visual Studio.NET. Preliminary results were surprising. Even though database access is slower than simply retrieving view state from the hidden _ V E S A Efield, when the view state is large _IWTT enough and it is since our application manipulates a lot of dynamic data the reduction in page download and postback time outweighted storing the view state to and retrieving from the database! In other words, by serving leaner pages we were able to process more requests within the same time span of a stress test cycle and save bandwith while persisting view state in the database.

"View State Is Invalid" Error Message When You Use Server.Transfer


Actually, this is exactly how KB316920 up in newsgroups quite often. is titled. This KB article deals with an issue I've seen come

Here's the gist of the problem. Suppose you have a web page. The first page has a MAC appended to its view state (which is done by default, remember?). Now, what if you need to call S r e . r n f rand you want to preserve its Q e y t i gand the Form collection? You may do so evrTase urSrn by calling an overloaded S r e . r n f rand passing true as its second parameter. evrTase Next, when this second page is invoked it receives the view state of the calling web form in its _ V E S A Ehidden field. The view state authentication check will fail since the newly arrived view _IWTT state is invalid on the second page. The KB article makes its point clear view state is page scoped and is valid for that page only. View state should not be transferred across pages.

Summar
View state is of tremendous value for web developers. It abstracts you from the dirty work of persisting and restoring control values between page postbacks. However its ease of use has a price tag on it and you need to clearly understand when you do need to maintain view state at the

aspnetresources.com/articles/Vie State

expense of serving larger pages, and when you don' at the expense of inability to facilitate

6/19

11/22/11
e pen e of e ing la ge page , and hen o d namic da a. Decide j dicio l ha o a icle a gh o ho o ec e he ie of eb fo m and pe i i on he e e .

ASP.NET State Management: Vie


don' a he e pen e of inabili

State

o facili a e

o e in he ie a e o a oid inc ing o e head. Thi a e f om ampe ing. Yo al o lea ned ho o ake i o

90 commen
John Sp lin

on Ap il 08, 2004 Thi i he be a icle on ie a e I ha e ead. I i conci e and ho o gh.

and on Ma 22, 2004 I' e been ea ching fo eek fo a doc men like hi . ell done. hank !

Robe Pegg on J ne 09, 2004 Thank ! I ha e been o king in a fa m en i onmen and la el ha e n in o ome ie a e

i e . Al ho gh I nde ood ie a e (o ho gh I did), I needed a l le mo e dep h in an ea o ead and comp ehend fo ma . I app ecia e o aking he ime o i e hi do n.

Ni anjan S ini a an on A g Ve 17, 2004 p he g ea o k.

l cid e plana ion. Keep

Don Almeida on Sep embe 30, 2004 I he e a i e limi ai on on Vie S a e?

Milan Nego an on Sep embe 30, 2004 I don' hink he e' a limi a ion.

Bid on Oc obe 01, 2004 I a g ea a icle on Vie a e.

Damien McGi e n on No embe 29, 2004 I' e al a been a of ie a e; no I'm ca ed of i ! G ea a icle.

La

Kjeld en 05, 2005 ead on ie a e - eall good o k. Thank fo p ing in he effo .

on Jan a Be

a icle I ha e e e

aspnetresources.com/articles/Vie State

7/19

11/22/11
Le Ja H i e i e e a 25, 2005 ide a e if he e age' i e b ie a e e .

ASP.NET State Management: Vie

State

he

ee i g i

e if he

age i acce

Milan Nego an Ja Whe ea Whe a 25, 2005 i Se i ID, i'

e e a e acce a age a he a e i e each e ge e hich ie a e g e i h hich e e i . a e e a age i e e a i d / ab f hei b

e , he e

ID

he a e. Y Whe he a c

eed hi hi f ic cc a a a

age a he e ac i de e d h ,I d '

a e i ec d a ic ha ab i.I ' a

d c ea e a c age i , i.e. h ib e, e

f ic . ch i ea i ic

ie a e cha ge . Pe ce a i .

ga S i e Feb a 28, 2005 ed c e hi a ic e a bac ac e i e , a d fi a eed e f i e g a d ha i g

I' e

f i . I ' a e ce e a ic e, e achi e e ge e a ha a ed

ab ie . Tha !

a e, a d

Milan Nego an Feb G ad ' e f a 28, 2005 ga . ;)

d i he f , M

Na ee Ma ch 17, 2005 Ve cid, e c ehe i e, i ed i a !

ba a Ma ch 17, 2005 I e he f .

i Redd Ma ch 24, 2005

Thi i .....

he e ce e

a ic e. I ha e e e

ee

hi

ch g

d a ic e

ie

a e... Kee

Si i ha A Ca f ie d b i 28, 2005 be f hi g a d a gge i . ed

ea e he e .I a faci g a b e , I ied fai ed ge he i ,fi a decided a a . e e e c a dc e

I ha e ead a b he f ef ec ha e a c ec i a

B Ni hi .Wi h i ' a d . I ha c ec i ha a i bac i a be f i e ie

i h he a e .I e ie . I

c ea ed b R ede . I ha e c ea e a e c i h i c ec i . he he i e ihi c a e i ed f he fi i e .b i i h i g he c ec i c af e a 4(

ge i g he f e a e ,b ec i ).

ge i g he I added i he

aspnetresources.com/articles/Vie State

8/19

11/22/11
). B C . I . R S , I .

ASP.NET State Management: Vie

State

.Y .T

S M H T , .I V S .[ .I ] 06, 2005

Milan Nego an M S , 06, 2005 .T ASP.NET F ' . .T

B M T . 26, 2005 V S S I !K

M A D

O 29, 2005 ' . V S , ' . ! :) I .T O OM .I ?I

MB

.I

Milan Nego an A M ' L O I N K . ' . .H , 30, 2005 , I' .M .

B S I

W 12, 2005 I ( S ), P C , B S ?I ? , I P B , I

, V S

aspnetresources.com/articles/Vie State

9/19

11/22/11

Thank ,

ASP.NET State Management: Vie

State

Milan Nego an on Sep embe 12, 2005 B an, o can' change ie a e f om clien - ide c ip . Yo can go ahead and elec /de elec checkbo e f om j e en if o di able ie a e on hem. ASP.NET e o e hei a e an a .

ill

JfK on Oc obe 13, 2005 Can I Ge Rid Of Vie S a e Comple el ? Yo aid NO, I a YES: ha o ha e o do i :

1. n off Vie S a e in no mal 2. O e ide o f nc ion in cla and LoadPageS a eF omPe n ll.

a (machine.config, eb.config, @ di ec i e, ha e e ) inhe i ing f om Page: Sa ePageS a eToPe i enceMedi m one ha hing o be emp , econd one e n

i enceMedi m. Fi

3. Tadaaa, no Vie S a e on he page. The onl o con ain ie a e.

hich i lef i hidden inp

hich o gh

Milan Nego an on Oc obe 13, 2005 I o ldn' go ha fa beca e he page "check m" i he e fo a ea on.

JfK on Oc obe 27, 2005 Hmm, ok, b ha i he ea on fo hi 'check m' hen o don' e ie a e an a ?I

mean ha hen o ' e ned off ie a e fo o app o machine h ho ldn' o ge id off hi li le ie a e c ap ha i lef behind? If I ha e ome ime I'll di e in o F ame o k in hope of e plo ing ha i hi 'check Ge Ha hCode of he page, b I'm no m' ea on (I pe e abo i ) onall hink ha i i o p of

R chi a on Jan a Thi i he be 31, 2006 a e i ha e ead o fa ....

a icle on ie

O lin on Feb Fan a a 17, 2006 a icle I ha e ead in m life.

ic a icle! One of he be

E ik on Ma ch 06, 2006 Milan, o aid 'I o ldn' go ha fa beca ha e he page "check kno m" i he e fo a ea on.'. I ha i he e 'fo

can' find an a ea on'?

he e

he ea on e acl i .. do o

mo e han j

Milan Nego an on Ma ch 06, 2006 I'm no 100% e ho he ba e-bone check m i b il , b he e' eall no a of ge ing

id of i comple el .

aspnetresources.com/articles/Vie State

10/19

11/22/11

ASP.NET State Management: Vie

State

K A R . 25, 2006 .T M N

B M I .T

H 26, 2006 .I 82,000+ C# .C VB I , .I . PC .I . I .I I .O SQL S .I

I O I I

,B

V J T . 06, 2006 I V S .T

A J T A

G 12, 2006 ... V .

J J B 15, 2006 I' , I' .

J H G8 A M !!! !!!

23, 2006

....

J T D

26, 2006 E .

aspnetresources.com/articles/Vie State

11/19

11/22/11

ASP.NET State Management: Vie

State

a J E ce e d c be ie e ha a e i g 19, 2006 e ,b a e ' he e ge e a a i g he i c e ec i a i e f a ed ;) I a e he e? D ea i I' a i e a a id! e ea a g i g ec e

e HTTP? Whe

Milan Nego an J I hea , Ma 20, 2006 ! Tha ' h I gi e ce c de f hi ca i ca ;)

B ia Se Be

e be 21, 2006 ead ega di g Vie S a e - a ed i h a Da aG id ed! e f i - Tha i gi f a Dee Pi f

a ic e I' e e e ha e ha

G ea Sad e

da dea i g ' e ea

a Web Fa

a i g he i e

e di Oc g ea a ic e. b i ha e a d d af e a e a e c i . he i e ied f be 11, 2006 ha e e i ... i ed f e b e , chec b e , i b e , a d he a e f each fie d i h e e .f ("..."), b ig e he c ie a e . ,i bac he ead ih he age/c .a ad , i ' gge i ? f he a e i cha ged af e cce

ha i c bac , i ge c bac c ea ie

a d , eb i d bac . i' e

a da e de

a e af e

R.Na e h Oc Tha i e ha Ve be 13, 2006 M ch, hi ha bec ce Agai e Be a e ia i Vie S a e ic. U ade hi e

i i a N Be e be 08, 2006 ead ie a e - ea g d . Tha f i gi he eff .

a ic e I ha e e e

A a N Ia Te c f e be 17, 2006 ed. F he a c e da Ia i g fi e e a i e i h chec b hich ha a e a d he chec b e i

G idVie . O

Page_L ad I ead da a f i h a chec b . Whe

a fi e a d di I e ec a diffe e

a i i a G idVie , ad, a

a e Fie d

chec ed/ chec ed a he e e f he fi fi e. I d ' a he be i e hi . I a he g hei i i ia a e . I ied b h e ab e/di ab e Vie S a e f he chec b f af e A he G idVie he fi ecia e a a df iece he age. N Id hi g cha ge . The chec b g? O a be hi i e e ai he a e f e a a . fi e- ad. Wha d f ad i e. Vie S a e i

J h N Li e e e

A. Da i e be 17, 2006 e e e, I hi hi a ic e i g ea . I a ' e e i gf hi i f , ha i g gi e

aspnetresources.com/articles/Vie State

12/19

11/22/11
L ,I V A I'

ASP.NET State Management: Vie


.I ' .B I . I ,

State

Milan Nego an N A D ? , 26, 2006 G , ' I .

R N T 30, 2006 V S .V !T .

V M J W D

P 15, 2007 . :-) V . .I .A

R V

C A T V 01, 2007 :). I 4 , , I' V :D ,

M W ' .A

17, 2007 V ' ' V , "S S , S ' ' .I , V ' V S ? , V S ". B , ,

W M

W 29, 2007 . .

A V T

N J T 28, 2007 .T .E .

aspnetresources.com/articles/Vie State

13/19

11/22/11
J A J S B S . D L F S P .S S ' T P M B , I .Y 07, 2007 , I'

ASP.NET State Management: Vie

State

F ,

.S S B

S ?

'

'

Milan Nego an A J [S , .I ]. , 08, 2007 , ,

J A I S B , , ( T R , 09, 2007 S B : "T ) .I ." .I S S T S W B .T D 64

Milan Nego a A T S B 09, 2007 , R ... .S . :) , .I ' ' S .I B '

J A T S [" S S L .S .C F I I' S P S T P M .S F ( (); , S S P B S , ' S B . T P L F M , , S B , I' ' .S . B W = , ); B "] = " = "; = = L S S F B W (); ( (); ); 10, 2007 : S B ();

Milan Nego an A I' E 10, 2007 ' , .I D

aspnetresources.com/articles/Vie State

14/19

11/22/11
E S P S T P M

ASP.NET State Management: Vie


.I .

State

J A T S S W B B I' (. . , .S ,I , T I ? S B S B , .I __VIEWSTATE / I' , .I I .I ' .I ). I , HTTP . . 10, 2007 .H " S B "

22, 2007 .

I . .I

Milan Negovan S D . I ? , 24, 2007 .O , '

houhuanjia D T ASP.NET S ASP.NET ============================ --T ASP.NET H D ID V S ? .S ! . -"F C 18, 2007 .S " .

Pri ank D V U ... 20, 2007 ...

J J F

S 02, 2008 ,M .I I .T !

sgoll F T 05, 2008 I .N , .V

aspnetresources.com/articles/Vie State

15/19

11/22/11
T . T . I .N

ASP.NET State Management: Vie


, .V

State

Soum a M T I . V S . 21, 2008

Mark J I M , " A ,B P " ". " , 19, 2008 .R M

'

...

S J J , " P

T 18, 2008 S . " S P S T P M

Stefan O T F ! I V S . 10, 2008

Chintan O D . 15, 2008 .C

Milan Negovan O C : ,I 15, 2008 ' .

S ed Shees Abidi N G 25, 2008

ASPNETC D V ??? 01, 2008 ASP.NET .

aspnetresources.com/articles/Vie State

16/19

11/22/11

ASP.NET State Management: Vie

State

Milan Negovan D I 02, 2008 .

Vija Kumar D T .I E IT 20, 2008 V S Y .I W H S V U .

J A .I

12, 2009 .NET, .T .

Karlton Kemerait F T . :// . . 02, 2009 , .I

chandan bora A R T . 10, 2009 , .

Gokul McNg O I 23, 2009 .G !!

S O I ' N W Y T F B ? P B F B 27, 2009 ... .

Milan Negovan O S , 27, 2009 .I .

John D er D V 07, 2009 .L .W I

aspnetresources.com/articles/Vie State

17/19

11/22/11
.I .S I .W ISA

ASP.NET State Management: Vie


,I ( .S .A I :

State
),

.A

A T J !

Milan Negovan D J , I' 16, 2009 ISA S .

raghu F E A .I . ..M 04, 2010 A . .V G

prasanna Y F T F ! I 08, 2010

DanG F V , 24, 2010 !

T M Y ' C S

H 23, 2010 , C .O ... ;) ; :// S , ' , ASP.NET' S /L S T P M ASP.NET2.0,

Milan Negovan M T , 28, 2010 !

aspnetresources.com/articles/Vie State

Anil Redd

18/19

11/22/11
Anil Redd on April 12, 2010

ASP.NET State Management: Vie

State

Thanks for posting such an awesome article. Pointed out all the aspects abt View state. U rock...Keep up the good work.

C opyright 2004

2010 by Milan Negovan | Search powered by Microsoft Bing

aspnetresources.com/articles/Vie State

19/19

Vous aimerez peut-être aussi