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"] = "
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"] = "