Re -write url in asp.net
First Create two hyperlinks in default.aspx page and paste the following
-------------------------------------------------------------------------------------------------------------------------------------------------
<asp:HyperLink Text="ASP.net" runat="server" ID="link1" NavigateUrl=" "> </asp:HyperLink>
<asp:HyperLink Text="PHP" runat="server" ID="HyperLink1" NavigateUrl=" "> </asp:HyperLink>
Then create a global.asax file and paste the same under <script>
-------------------------------------------------------------------------------------------------------------------------------------------------
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(System.Web.Routing.RouteTable.Routes);
}
public static void RegisterRoutes(System.Web.Routing.RouteCollection routeCollection)
{
routeCollection.MapPageRoute("RouteForCustomer", "soumen/{training}", "~/soumen.aspx");
}
Now since because you are passing like a value "training" you just need to make the url of same kind , so that the global.asax page can track it.
Now paste the below code under default.aspx file
-------------------------------------------------------------------------------------------------------------------------------------------------
link1.NavigateUrl = Page.GetRouteUrl("RouteForCustomer", new { training = "ASP.net"});
HyperLink1.NavigateUrl = Page.GetRouteUrl("RouteForCustomer", new { training = "PHP" });
Now add a page soumen.aspx here i have added one. and paste the underlying lines
--------------------------------------------------------------------------------------------------------------------------------------------------
string category = Page.RouteData.Values["training"] as string;
lbl.Text = category;
thats it.