0

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 Answer 1

1
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]);
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.