Professional Documents
Culture Documents
First We Have To Add "Global - Asax" File Into Our Application. Collapse
First We Have To Add "Global - Asax" File Into Our Application. Collapse
First We Have To Add "Global - Asax" File Into Our Application. Collapse
Collapse
// Write this method prototype like this,
if (absoluteUrl.Contains("/test/default.aspx"))
{
Response.Redirect(path);
// STEP 1 (ShowContents.aspx)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// This page displays contents from a database for a ContentID. This file
// STEP 2 (Global.asax)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// the project. This file captures the incoming requests' URL, gets the
// Content ID of the content related to the URL and redirects the user to
if (File.Exists(Request.PhysicalPath))
{
// Do nothing here, just serve the file
}
// If the file does not exist then
else if (!File.Exists(Request.PhysicalPath))
{
// Get the URL requested by the user
int nId = 0;
////// nId = GetContentIDByPath(sRequestedURL); \\\\\
// address bar
Context.RewritePath(sTargetURL, false);
}
}
// That's all! :-)