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

  • Home
  • SEARCH
  • 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 7584397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:54:38+00:00 2026-05-30T18:54:38+00:00

I have an .Net MVC 3 web application that has the following structure root

  • 0

I have an .Net MVC 3 web application that has the following structure

  • root
    • Views
      • Account
        • LoginPage.aspx
    • Controllers
      • AccountController
    • Areas
      • Course
        • Index.aspx

Imagine I am currently at the Index.aspx page in the Course area, and I would have a button that would forward me to the LoginPage.aspx

In a ASP.Net MVC I would call http://localhost/Account/Login that it would lead me to the correct page. If I just write it down on the browser it works!

But I would like to use the HTML Helper ActionLink, so I tried:

<%: Html.ActionLink("Log on", "Login",  "Account", routeValues: null, htmlAttributes: new {  id = "logonLink", data_dialog_title = "Logon" })%>

It get the relative path: http://localhost/Course/Account/Login

I tried also:

<%: Html.ActionLink("Log on", "Login",  "../Account", routeValues: null, htmlAttributes: new {  id = "loginLink", data_dialog_title = "Login" })%>

I got the error message: Cannot use a leading .. to exit above the top directory.

I also tried the relative path:

<%: Html.ActionLink("Log on", "Login",  "~/Account", routeValues: null, htmlAttributes: new {  id = "loginLink", data_dialog_title = "Login" })%>

And it lead me to:

http://localhost/Course/~/Account/Login

I would really appreciate how to find a solution for this problem.

  • 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-30T18:54:39+00:00Added an answer on May 30, 2026 at 6:54 pm

    Try this:

    <%: Html.ActionLink("Log on", "Login",  "Account", new { area = "" } , new {  id = "logonLink", data_dialog_title = "Logon" })%>
    

    The key is the area = "" bit. When using Url.Action or Html.ActionLink with areas, if you don’t specify the area route value, MVC will only look for a match in the current area.

    It get’s even more important when using partial views/templates, since they can be rendered in Views in different areas.

    So if using areas, get into the habit of always specifying the area route value, unless using Url.RouteUrl or Html.RouteLink.

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

Sidebar

Related Questions

Say I have an application with the following structure. // ASP.NET MVC (Web Project)
I have an Asp.Net MVC application that works in the vs.net development web server.
I have an ASP.NET MVC application that has a jQuery Treeview and a jQuery
I have an Asp.Net MVC Web Application that I am developing. I have TeamCity
I have an ASP.NET MVC Web Application that interacts with a SQL Server 2008
Other than the fact that ASP.NET MVC Web Application has more clarity in its
I am building a multi-layered application that has an ASP.NET MVC web application. It
I have an asp.net mvc application that uses partial views. How do I know
I currently have a ASP.Net MVC web application that needs to upload large files
We have a web based (ASP.NET MVC) application that uses SQL Server 2008 for

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.