Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4331382
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:05:59+00:00 2026-05-21T10:05:59+00:00

If I have some routes set up as follows: context.MapRoute(Route1, Public/DataCapture/Name, new { controller

  • 0

If I have some routes set up as follows:

context.MapRoute("Route1", "Public/DataCapture/Name", new { controller = "Profile", action = "Name" } );

context.MapRoute("Route2", "Public/DataCapture/Age", new { controller = "Profile", action = "Age" } );

context.MapRoute("Route2", "Public/DataCapture/Amount", new { controller = "Income", action = "Amount" } );

How can I generate URLs that use the route path and not the actual controller/action path?

E.g.

Url.Action("Name", "Profile")

Should generate “Public/DataCapture/Name” rather than “Public/Profile/Name”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:06:00+00:00Added an answer on May 21, 2026 at 10:06 am

    Try using Url.RouteUrl.

    In the past, when I have had problems getting that to return the correct route, it was usually an indication that either my routes were not defined in the correct order, or I was doing something that kept the routing system from matching the route I intended.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this set of routes: routes.MapRoute( IssueType, issue/{type}, new { controller = Issue,
I have some controller logic: public function seafood() { $this->set('title', 'Seafood restaurants in and
I have routes set in AngularJS like this: $routeProvider .when('/dashboard', {templateUrl:'partials/dashboard', controller:widgetsController}) .when('/lab', {templateUrl:'partials/lab',
In routes.rb, I have: [some routes] match '/me' => scores#all_athlete_scores, :constraints => LoggedInChecker devise_scope
In express, I have defined some routes app.post(/api/v1/client, Client.create); app.get(/api/v1/client, Client.get); ... I have
I have some tables roughly like so: Client: id name Employee id name Email
I have 2 similar routes set up for my ZF application, one of which
I have an existing rails application to which i am adding a new controller
I have some issues with a controller in my rails3 application that is called
I'm doing this in application controller: before_filter :set_app_host def set_app_host Rails.application.routes.default_url_options[:host] = some url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.