Click here to Skip to main content
13,799,870 members
Rate this:
 
Please Sign up or sign in to vote.
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 3-Jan-18 3:42am

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.181214.1 | Last Updated 3 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100