Hello there,
If you were wondering how to do search engine friendly urls in asp.net go no further. The key is the Global.asax file in your root. Put this code in for this example to get the number after /search/dist/ and run the file specified. :-
1 2 3 4 5 6 7 8 9 10 11 | protected void Application_BeginRequest(Object sender, EventArgs e) { HttpContext incoming = HttpContext.Current; string oldpath = incoming.Request.Path.ToString(); if(oldpath.Contains("/search/dist/")){ string[] sstring =new string[6]; sstring=oldpath.Split('/'); //Web_Security.SearchDistributions=Convert.ToInt32(); incoming.RewritePath("~\\search\\Default.aspx?dist=" + sstring[4]); } } |