i have a button click event from i am doing to redirect in same page with different url and i have a route for that url in global asax file but its not working on button click
its only working on html anchor tag only how can i do that
my code as follows
global asax route
routes.MapPageRoute("mmmm2", "hotels/{id}/", "~/products.aspx");
routes.MapPageRoute("maincat123", "hotels/{id}/{city}/", "~/products.aspx");
code behind
string subcat = Page.RouteData.Values["id"].ToString();
HtmlButton btn = sender as HtmlButton;
HtmlInputText txt = btn.Parent.FindControl("Text2") as HtmlInputText;
string city = txt.Value;
string url = "hotels/" + subcat + "/" + city + "/";
Session["temp"] = url;
Response.Redirect(url);

Michael GriffithsRank #1,251 · 1.4K reputationPosted Apr 29, 2016, 3:36 PM EDT
The madness docs explain it
https://msdn.microsoft.com/en-us/library/dd992853(v=vs.110).aspx
Michael GriffithsRank #1,251 · 1.4K reputationPosted Apr 29, 2016, 3:37 PM EDT
Michael GriffithsRank #1,251 · 1.4K reputationPosted May 1, 2016, 1:50 AM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted May 1, 2016, 7:08 AM EDT