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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:49:08+00:00 2026-05-26T19:49:08+00:00

I have an ASP.NET MVC 3 application with 2 areas which are seperate projects

  • 0

I have an ASP.NET MVC 3 application with 2 areas which are seperate projects referenced from the main application. Both the area projects sit with the Areas directory of the main application. I was wondering if i can call DisplayTemplates from one area in another.

For example i have added the following template in the ~/Areas/Area1/Views/Shared/DisplayTemplates/Test.cshtml file:

@model string
Test Display Template

Now within a view in the Area2 project i say:

@Html.Display("Test", "~/Areas/Area1/Views/Shared/DisplayTemplates/Test.cshtml")

But it doesn’t display anything. I was wondering if someone could let me know if this is possible and what i am doing wrong.

Thanks

  • 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-26T19:49:08+00:00Added an answer on May 26, 2026 at 7:49 pm

    If you would like to share templates across Areas, place the template in the root View directory.

    Instead of;

    /Areas/Area1/Views/Shared/DisplayTemplates/Test.cshtml
    

    Place it here;

    /Views/Shared/DisplayTemplates/Test.cshtml
    

    Also, the second argument of your Display helper method call;

    @Html.Display("Test", "~/Areas/Area1/Views/Shared/DisplayTemplates/Test.cshtml")
    

    Should be this;

    @Html.Display("Test", "Test")
    

    As the second argument is your template name.
    The MVC view engine will track down the template on name, not directory. This is a cleaner approach.

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

Sidebar

Related Questions

I have an ASP.NET MVC-application which I want deployable on both IIS6 and IIS7
I have a ASP.NET MVC application that runs in both IIS 6 and 7.
I have an asp.net mvc 2.0 application that contains Areas/Modules like calendar, admin, etc...
I am creating a modular ASP.NET MVC application using areas. In short, I have
I have ASP.NET MVC application with action which should process posted XML data. At
I have an ASP.NET MVC 3 (Razor) Web Application, with a particular page which
i have quite big ASP.NET MVC 2 application (multiple areas, each with own routing
I have an ASP.Net MVC 3 application. With 2 Areas: Auth - handles all
I have defined an area (Admin) in my ASP.NET MVC 3 application, created _ViewStart.cshtml
I have ASP.NET MVC web application. I need to deploy it which consists of:

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.