Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

1. From Register.aspx, I want to navigate to AvailableCourse.aspx with a value that indicates course id selected from Register.aspx.
2. I use Response.RedirectToRoute method to navigate to AvailableCourse.aspx from Register.aspx.

My RouteConfig.cs
routes.MapPageRoute("Register", "Register.aspx", "~/Register.apsx");
routes.MapPageRoute("AvailableCourse", "AvailableCourse/{selCourseId}", "~/AvailableCourse.apsx");

var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);


My question is:How to pass that selCourseId from Register.aspx to AvailableCourse.apsx and how to receive the passed selCourseId in AvailableCourse.cs file ? I am using web application project and I dont have action/control explicitly in my code.
So my expectation is navigation from
http//myserver/Register
to
http//myserver/AvailableCourse/2
http//myserver/AvailableCourse/3


Thanks in advance.

What I have tried:

I tried searching in google but most resources are related to action method but I have used a web application project and friendlyurl feature of MVC, and I dont have action method in my web page.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900