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 6208893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:53:05+00:00 2026-05-24T05:53:05+00:00

Given URI /admin/article/index, why would this url mapping not work? /admin/$controller/$action?/$id?{ view = /admin/index

  • 0

Given URI /admin/article/index, why would this url mapping not work?

"/admin/$controller/$action?/$id?"{ 
        view = "/admin/index" // no dice, ignored 
        //action = "foo" // uncommented, this is picked up 
} 

I’d like for all admin controllers to use the admin view by default (and not have to render the view in each action of each controller). Same goes for “/account/$controller/…” and any other site module that should use a common view.

Perhaps there’s another way to achieve this, but assumed that UrlMappings is the place to do it…

  • 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-24T05:53:06+00:00Added an answer on May 24, 2026 at 5:53 am

    Looks like you are trying to do something very different than what you wrote.

    You already have the action mapped in the base URL mapping, and the view is automatically selected based on the controller, so you need to define different mappings for those views that don’t have a controller, and yet another mapping for items with a default action of foo. The default action on controllers is index, though, so there is usually no need to supply a default action without also specifying a controller.

    I think you are, in general, misunderstanding how an MVC framework works. The controller should not be rendering anything, and the views should be specific to the controller/action. If multiple controllers are rendering the exact same view, I’d be willing to bet that either the controller is rendering HTML or the view is overly complicated.

    You should look into Layouts with SiteMesh, which allows you to create default template structures, then just have the specific content change through views.

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

Sidebar

Related Questions

Given a uri like /home/ I want to find the view function that this
This should be simple. I want to get an absolute Uri given the controller,
Given an absolute URI/URL, I want to get a URI/URL which doesn't contain the
Given the Following Code how Would i Change/Set my Silverlight WCF Service URI in
Given this XML file: <?xml version=1.0 encoding=UTF-8?> <root> <data> <track clipid=1> <url>http://www.emp3world.com/to_download.php?id=33254</url> <http_method>GET or
Given a pack:// URI, what's the best way to tell whether a compiled resource
Given an absolute or relative path (in a Unix-like system), I would like to
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
I need to get RoutData by given URL string in ASP.NET MVC application. I've
I need to extract only the second path segment of a URI i.e. given

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.