ASP.net track previous send url

if (Session["hdBackURL_AddUser"] != null)
{
string sessionSavedUrl = Session["hdBackURL_AddUser"].ToString();
string requestedUrl;
if (Page.Request.UrlReferrer == null)
requestedUrl = "zAddUser.aspxz";
else
requestedUrl = Page.Request.UrlReferrer.ToString();
           
if ((requestedUrl.Contains("AddUser.aspx") == false) && (sessionSavedUrl != requestedUrl))
Session["hdBackURL_AddUser"] = Page.Request.UrlReferrer.ToString();
}
else
Session["hdBackURL_AddUser"] = Page.Request.UrlReferrer.ToString();


btnCancel.PostBackUrl = Session["hdBackURL_AddUser"].ToString();

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...