如何存储viewstate [英] How do I store viewstate

查看:75
本文介绍了如何存储viewstate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为字符串声明viewstate变量并将其存储在字符串变量中?

解决方案

用于存储:

 ViewState [  YourKey] =    YourValue; 



获取:

  string  yourvalue = ViewState [  YourKey] 





请参考以下链接:



初学者指南查看状态 [ ^ ]

ASP.NET Web窗体 - 维护ViewState [ ^ ]

ASP.NET视图状态概述 [ ^ ] < br $> b $ b

祝你好运

 ViewState [  yourStringViewStateID ] =  字符串; 

string str = ViewState [ yourStringViewStateID];





str里面会有一个字符串。



是那个所有你需要知道的?


How do you declare viewstate variable for string and store it in a string variable?

解决方案

For storing :

ViewState["YourKey"]= "YourValue";


For getting :

string yourvalue = ViewState["YourKey"]



Please refer following links :

Beginner's Guide To View State[^]
ASP.NET Web Forms - Maintaining the ViewState[^]
ASP.NET View State Overview[^]

Good luck


ViewState["yourStringViewStateID"] = "a string";

string str = ViewState["yourStringViewStateID"]; 



str will have "a string" inside.

is that all you need to know?


这篇关于如何存储viewstate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆