I need the if statement to do something. This would not work because anything after that schema "/" will always be there. I put the below code in the BeingRequestion method in global and it executes every time. I only one to rewrite the url when the "test" user is provided.
Code:Uri uri = new Uri(Request.Url.ToString()); Response.Write(uri.AbsoluteUri.ToString()); Response.Write(uri.PathAndQuery.ToString()); if (uri.PathAndQuery.Length > 0) //this is what I need { string sUser = System.IO.Path.GetFileNameWithoutExtension(Request.PhysicalPath); app.Context.RewritePath("~/default.aspx?user=" + sUser); }




Reply With Quote