Redian新闻
>
Summary: 2 个web form之间如何传参数?
avatar
Summary: 2 个web form之间如何传参数?# DotNet - 窗口里的风景
c*o
1
To the best of my knowledge, there are seven methods to pass parameters
between web forms. Session variable method is the one I used most frequently.
Any comments are warmly welcomed!
1. global variables in Gloable.asax
2. application variables: Application["username"]="peter"; //any type of data
3. session variables: Session["username"]="peter"; //any type of data
4. viewState variables: ViewState["username"]="peter"; //only String data type
can be used
5. Context: Context.Items["username"] = "
avatar
z*u
2
Session uses too much resources when the server runs under load.
ViewState does not work well with different pages. As 1,2,3, it does not work
for different pages under different applications.
Server.Transfer has to transfer to the same application either.
Redirect works great, except the URL size has limitation(1K)
Cookies depend on browser support.
Next version of ASP.net will support it :)

frequently.
data
type
as
user

【在 c*o 的大作中提到】
: To the best of my knowledge, there are seven methods to pass parameters
: between web forms. Session variable method is the one I used most frequently.
: Any comments are warmly welcomed!
: 1. global variables in Gloable.asax
: 2. application variables: Application["username"]="peter"; //any type of data
: 3. session variables: Session["username"]="peter"; //any type of data
: 4. viewState variables: ViewState["username"]="peter"; //only String data type
: can be used
: 5. Context: Context.Items["username"] = "

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。