摘要: PersonSession person = new PersonSession(int.Parse(txtPersonId.Text), txtName.Text, int.Parse (txtAge.Text),chkEmailValidated.Checked);PersonSession.CreatePersonSession(person);----------------------... 阅读全文
posted @ 2010-02-19 22:32 greencolor 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Session data is lost when the visitor leaves the webpage.ASP.NET Profile provides a neat way to persist information for a long time.<profile> <properties> <add name="Id" type="Int32"/&g... 阅读全文
posted @ 2010-02-19 21:43 greencolor 阅读(280) 评论(0) 推荐(0) 编辑
摘要: protected void Page_Load(object sender, EventArgs e) { if (Session["name"] != null) Response.Write(Session["name"]); } protected void btnCreateSession_Click(object sender, EventArgs e) { Session["name... 阅读全文
posted @ 2010-02-19 21:28 greencolor 阅读(406) 评论(0) 推荐(0) 编辑
摘要: Session id的存储方式有以下四种1、AutoDetect Web.config做相应的配置如下:<system.web> <sessionState cookieless="AutoDetect"> </sessionState></system.web>ASP.NET 确定请求浏览器或请求设备是否支持 Cookie。如果请求浏览器或请求设备... 阅读全文
posted @ 2010-02-19 20:48 greencolor 阅读(363) 评论(0) 推荐(0) 编辑
摘要: string queryStringValue = Request.QueryString["key"]; if (string.IsNullOrEmpty(queryStringValue)) { // querystring not supplied. Do necessary action } else // Querystring supplied. continue execution 阅读全文
posted @ 2010-02-19 00:11 greencolor 阅读(194) 评论(0) 推荐(0) 编辑
摘要: // encoding querystring string id = "1"; string name = "foo#"; string url = string.Format("foo.aspx?{0}&{1}", Server.UrlEncode(id), Server.UrlEncode(name)); Response.Redirect(url); // decoding can... 阅读全文
posted @ 2010-02-19 00:07 greencolor 阅读(159) 评论(0) 推荐(0) 编辑