Tech
Forums
Jobs
Books
Events
Conference
Annual Conference
Bcrypt
Live
Learn
More
Training
Interviews
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
how to call global asax route on code behind button click
Vishal Singh
Apr 29 2016 2:18 AM
310
Reply
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);
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
I want to display the selected dates full in label?
CRUD operation with multiple tables using DAL and BAL (No EF