In asp.net, how can I know which attributes are stored in ControlState and which in ViewState? Are there any official documents on this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I didn’t see any public information about this, but you easily can find out this by yourself. Just dowlnoad Reflector, run it, select appropriate version of the framework (3.5 for example), click on search button, add methods selection (at the right of the search box) and type RegisterRequiresControlState – this method belongs to Page class, control needs to invoke this method to be (become? sorry for pidgin English) allowed to store data. After this doubleclick on the search result and the tree on the left will be expanded and this method will be selected. Right click on the method and select “Analyze”. A new bar will be opened at the right. Expand “Used By” node and you’ll get all controls which are using control state. Doublclick on the control you need, and select “SaveControlState” method of this control. Right click – disassemble. Voila, you’ll see the source of this method and you’ll see what exactly it stores in the CS.
Also you may search for “SaveControlState” method directly.
Reflector is free and it rocks.