首页 新闻 会员 周边 捐助

如何取出viewstate中的值,并且还原

0
[已解决问题] 解决于 2015-06-18 21:56
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJOTU1NDUwNTMxDxYEHglGbHVzaE51bWICAR4HTW9kZWxJRAUEMzU5NRYCAgEPZBYCAgMPZBYCZg9kFigCEg8PFgIeDU9uQ2xpZW50Q2xpY2sFaU9wZW5Nb2RlbFdpbkZyb20oJy9OZXdXYXRlck1hbmFnZS9Db21tb24vU2VsZWN0SXJyaWdhdGlvbkRyYWluYWdlLmFzcHg/T3JnYW5pc2VVbml0SUQ9NTEwJyk7cmV0dXJuIGZhbHNlO2RkAiYPEA8WBh4ORGF0YVZhbHVlRmllbGQFAklEHg1EYXRhVGV4dEZpZWxkBQROYW1lHgtfIURhdGFCb3VuZGdkDxYIAgECAgIDAgQCBQIGAgcCCBYIEAU85rWL6K+V5rmW5rOK5rWL6K+V5rmW5rOK5rWL6K+V5rmW5rOK5rWL6K+V5rmW5rOK5rWL6K+V5rmW5rOKBSRhNTMyYTAxZi1iNTMyLTQ2MTMtOTAwMi0wZDBiZmI4ODViNmNnEAUH5rKz5rWBMQUkYTQ0MWUwODAtZmY2Ny00YzIyLWI2YWMtMjBiYzQxMDU5MDI5ZxAFB+a5luazijMFJDMwMDAwZjAyLTMwMTYtNGVlMy04ZWY1LTJlODNmZDVkMTQ3MmcQBQfmuZbms4oxBSQyMTI0MTgzNC03MTYxLTQ1MWMtYmM2MC00NDI1MmY4ZWY3NWVnEAU85rWL6K+V5rKz5rWB5rWL6K+V5rKz5rWB5rWL6K+V5rKz5rWB5rWL6K+V5rKz5rWB5rWL6K+V5rKz5rWBBSQxODdiODE0OS1mNTE2LTQyMTItYTBjZC02MTliNDVlYWVmMmZnEAUH5rmW5rOKMgUkNGYwZGIxNWYtYTdkOC00ODc2LWI2NDktYjM3NzcxNzNhYzFkZxAFB+ays+a1gTIFJDc2YjNhZDA5LTllODYtNGRmZi1hY2MyLWJhYj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PFgQeDG1lc3NhZ1N0YXR1cwUBMR8CBS5pZiAoIWNvbmZpcm0oJ+ehruiupOS/neWtmO+8nycpKSByZXR1cm4gZmFsc2U7ZGQCggEPDxYCHgdWaXNpYmxlaGRkZGPZzXVGOT+B1FBAqiTxBRPjVphYjMhy/prAh+rABScg" />
</div>

如图,

 


怎么把它在后台取出来,并且还原成控件和值的形式

asdfgqq的主页 asdfgqq | 初学一级 | 园豆:8
提问于:2015-05-27 12:47
< >
分享
最佳答案
0
奖励园豆:5
dudu | 高人七级 |园豆:30948 | 2015-05-27 14:10

Note   You may be able to get away with loading your controls in the Page_Load event handler and maintaining the view state properly. It all depends on whether or not you are setting any properties of the dynamically loaded controls programmatically and, if so, when you're doing it relative to the Controls.Add(dynamicControl) line. A thorough discussion of this is a bit beyond the scope of this article, but the reason it may work is because the Controls property's Add() method recursively loads the parent's view state into its children, even though the load view state stage has passed.

请问上面这段话是什么意思?

 

asdfgqq | 园豆:8 (初学一级) | 2015-05-27 21:25
其他回答(3)
0

你的表单够大呀,这么多数据。

你在Request中的QueryString 和 Form中就可以拿到数据了,无需解析这个东西。

| 园豆:780 (小虾三级) | 2015-05-27 14:30
0

不明白,你是不会语法?再说了,控件状态是控件本身自己维护的。。。

顾晓北 | 园豆:10898 (专家六级) | 2015-05-27 15:33
0

数据挺大的啊。  不过没明白楼主什么意思。 是要清空?

请叫我头头哥 | 园豆:9382 (大侠五级) | 2015-05-28 11:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册