Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

Newbie, what is the following code doing

by the3factory 4/15/2008 5:05:00 PM
Question:
string strUrl = "SelectReport.aspx";

Session["browser"] = true;

HttpCookie cookieClientCode = new HttpCookie("cc", strClientCode);cookieClientCode.Expires = DateTime.Now.AddYears( 1 );

Response.Cookies.Add(cookieClientCode);

 

string strRefreshHeader = string.Format("0; URL={0}", strUrl);

Response.AppendHeader("Refresh", strRefreshHeader);


Answer1:

 It's setting a session variable and a cookie probably for use in later code, possibly the SelectReport.aspx page. Then it's setting a header in the response stream to redirect to SelectReport.aspx as soon as the page loads on the client.


Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0