Want to build the ChatGPT based Apps? Start here
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Vishal Singh
2.1k
12
8k
how to call global asax route on code behind button click
Apr 29 2016 2:18 AM
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);
Reply
Answers (
4
)
I want to display the selected dates full in label?
CRUD operation with multiple tables using DAL and BAL (No EF