views:

11

answers:

1

Hi;

Global.asax Code

protected void Application_BeginRequest(object sender, EventArgs e)
{
 string fullOrigionalpath = Request.Url.ToString();

 if (fullOrigionalpath.Contains("/Form/Electronic/Led"))
 {
  Context.RewritePath("/Form/Handler.aspx?Id=Led&cat=Electronic");
 }
}

How to make url map ?

Url: /Form/Car/Mercedes
Map: /Form/Handler.aspx?Id=Mercedes&cat=Car

Url: /Form/Animals/Cat
Map: /Form/Handler.aspx?Id=Cat&cat=Animals
+1  A: 
string fullOriginalPath = Request.Url.AbsolutePath;
if(fullOriginalPath.StartsWith("/Form/"))
{
  string[] parts = fullOriginalPath.Substring(6).Split('/');
  if(parts.Length == 2)
  Context.RewritePath("/Form/Handler.aspx?Id=" + parts[0] + "&cat=" + parts[1]);
}
Jon Hanna
@jon Hanna Thank you...
Oraclee