void Application_BeginRequest(object sender, EventArgs e)
{
System.Web.HttpContext httpContext = HttpContext.Current;
String currentURL = httpContext.Request.Path.ToLower();
string processPath =currentURL.Substring(httpContext.Request.ApplicationPath.Length).TrimStart('/').ToLower();
//Creates th
string physicalPath = httpContext.Server.MapPath(
currentURL.Substring(currentURL.LastIndexOf("/") + 1));
//checks to see if the file does not exsists.
if (!System.IO.File.Exists(physicalPath))
{
string queryString =httpContext.Request.ServerVariables["QUERY_STRING"];
string defaultPage = "~/PageViewer.aspx?process=";
if (processPath.EndsWith(".aspx"))
processPath = processPath.Substring(0, processPath.Length - ".aspx".Length);
// Rewrites the path
httpContext.RewritePath(defaultPage + processPath + "&" + queryString);
}
}
Sunday, February 01, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment