Hi
I can usually do the translation myself, but this time I am a bit stumped
Let us consider to rewrite Urls (more than 16000 links) using a table. Save original url and rewritten url in a table. Now add a class file in App_Code folder.
class UrlRewriteModule : IHttpModule
{
public void Dispose()
{
// Nothing to dispose
}
public void Init(HttpApplication context)
{
context.BeginRequest += new EventHandler(context_BeginRequest);
}
void context_BeginRequest(object sender, EventArgs e)
{
HttpContext context = HttpContext.Current;
if (context.Request.QueryString["Rewritten"] != null)
{
// Select the original url from database
context.RewritePath(originalUrl);
}
else if (context.Request.HttpMethod == "GET")
{
// Select the rewritten url from database and redirect to that page with a querystring
// or other identifier (like "?Rewritten=yes")
context.Response.Redirect(rewrittenUrl + "?Rewritten=yes");
}
}
// Other codes if needed
}
Hope this works for you.
![]() |
-1 |
![]() |
Convert C# to VB.Net
http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspxalso,
Convert VB.Net to C#
http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx
![]() |
1 |
![]() |
I have used this site with good results.
http://authors.aspalliance.com/aldotnet/examples/translate.aspx
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
![]() |
1 |
![]() |
Check below link
HC
Haissam Abdul Malak
MCAD.NET
| Blog |
![]() |
1 |
![]() |