There is a <a> tag in my page like: <a href="p-12-shirt.aspx">sport</a>.
If I change the tag to <a href="welcome">sport</a>, I still want to enter the "p-12-shirt.aspx" page but the url in the browser need to be "localhost/XXX/welcome".
What can I do?
I noticed that there was a "Custom_Application_BeginRequest_Logic" in the AppLogic.cs file.
I write:
public static bool Custom_Application_BeginRequest_Logic(Object sender, EventArgs e)
{
string Path = HttpContext.Current.Request.Url.ToString();
Path = Path.Substring(Path.LastIndexOf("/")+1).ToLowerInvariant();//get the "welcome"
if(Path == "welcome")
{
HttpContext.Current.RewritePath("p-12-shirt.aspx");
}
return false;
}
However, when I click the <a> tag, the url is changed to "http://localhost/XXX/Come.ttt" but the page can't be found.