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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:23:33+00:00 2026-05-23T09:23:33+00:00

I am creating a link inside the main _Layout.cshtml file inside a MVC3 application.

  • 0

I am creating a link inside the main _Layout.cshtml file inside a MVC3 application.

@Html.ActionLink("Security", "Index", "Home", new { area = "Security" }, new { })

When the page is rendered, this is the resultant Html

<a href="/Security">Security</a>

and if I click on this link, I get a blank page.

I have routedebugger installed and here are the results:

Route Debugger output

I have the default route inside the Global.ascx.cs as follows:

 routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            new string[] { "Eis.Mvc.Web" }// Parameter defaults
        );

and the Security Area’s route:

context.MapRoute(
            "Security_default",
            "Security/{controller}/{action}/{id}",
            new { area = "Security", controller = "Home", action = "Index", id = UrlParameter.Optional },
            new string[] { "Eis.Mvc.Web.Areas.Security.Controllers" }
        );       

If I directly type in the following URL, http://localhost:1410/Security/home, the correct page is presented.

How can I get the @Html.Action link to include the controller portion of the URL?

I do have a Home controller with an Index action inside the root portion of the application and had to include the Namespace filters to the route registrations.

Thank you,
Keith

  • 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-23T09:23:33+00:00Added an answer on May 23, 2026 at 9:23 am

    Change the Security Area’s route mapping to the following:

    context.MapRoute(
            "Security_default",
            "Security/{controller}/{action}/{id}",
            new { action = "Index", id = UrlParameter.Optional },
            new string[] { "Eis.Mvc.Web.Areas.Security.Controllers" }
        );    
    

    Notice the area and controller portions of the defaults parameter were removed.

    Now the @Html.ActionLink("Security", "Index", "Home", new { area = "Security" }, new { }) renders <a href="/Security/Home">Security</a>

    Keith

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

Sidebar

Related Questions

I'm creating and removing HTML from inside a div with jQuery (shopping cart, adding/removing
I am new to iphone development.I am creating a map application. I have created
I'm creating a link shortening service and I'm using base64 encoding/decoding of an incremented
Following on from a previous question , I am creating a symbolic link on
I'm creating a 'similar items' link table. i have a 2 column table. both
I'm creating a simple tag system that allows me to link a tag to
I read here ( http://androidlittle.blogspot.com/2009/08/intent-filter-for-share-link.html ) what intent-filter is required to handle the share
I am creating a Facebook application that will download all the photos in an
I'm creating custom control and because I need to do lot's of binding inside
All, I am trying to add Spring Security(3.0.7) to my web application(Spring 3.0.6, Tiles

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.