aspx 取出常见范围的值

aspx中如何快速取出常见范围的值

 1. request范围

 

后台代码:
  Response.Redirect("error.aspx?errorCode=111!"); 
  或其他提交queryString的方式比如表单提交、超链接等
页面使用
<%            
    Response.Write( Request.QueryString["errorCode"]); 
 %>


2.session范围

 

 

后台代码:
    Session["errorCode"] = "用户名或者密码错误!";
页面使用:
Session["errorCode"]


3. application范围

 

 

后台代码:
    Application["errorCode"] = "用户名或者密码错误!";
页面使用:
Application["errorCode"]

 

 

 

posted on 2013-11-11 15:11  babyblue  阅读(116)  评论(0)    收藏  举报