Monthly Archives - January 2008

Get the referring page on Page_Load event in ASP.NET

When a page loads, in order to get the name of the page that sent you there, all you need to use is: Request.UrlReferrer.ToString(); You can create a global variable to hold it: string sReferrer = ""; Then, in the Page_Load event, assign it: if (!Page.IsPostback) { sReferrer = Request.UrlReferrer.ToString(); } Or, you can put it in ViewState at...