User953143284 posted
Hi,
I've been trying to fix a problem that I've but I honestly donno if it can be donne.
I want to use URL ReWrite with a session value.
I tryed with Global.asax but on Application_BeginRequest session doesn't exists yet. Also on Application_AcquireRequestState but I think it's too late for the ReWritePath. This is what I've:
void Application_AcquireRequestState(object sender, EventArgs e)
{
// && HttpContext.Current.Session["key"] != null
if (System.Web.HttpContext.Current.Session != null )
{
string fullOrigionalpath = Request.CurrentExecutionFilePath.ToLower();
HttpContext.Current.Session.Add("passei", fullOrigionalpath); // Works ok!
if (fullOrigionalpath.Contains("aspx"))
{
if (fullOrigionalpath.CompareTo("/default.aspx") == 0)
{
HttpContext.Current.RewritePath("/Autenticacao/Login.aspx");
}
}
}
}
Any advice?