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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:06:25+00:00 2026-05-12T22:06:25+00:00

I am using T4MVC in our ASP.NET MVC project. I have a statement like

  • 0

I am using T4MVC in our ASP.NET MVC project.

I have a statement like this in my view:

<% Html.RenderPartial(MVC.SomeController.Views.PartialViewName); %>

Which was previously like this:

<% Html.RenderPartial("../SomeController/PartialViewName"); %>

Previously it was working fine, but after I specified the partial view using T4MVC, its not able to locate that partial view.

Its Just trying to find it in the below paths, which is the default behaviour.

~/Views/SomeController
~/Views/Shared

Is there a way to specify a partial view which is in some other controller’s views folder through T4MVC? or Whatever I am doing, is it correct ? What am I missing ?

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-12T22:06:25+00:00Added an answer on May 12, 2026 at 10:06 pm

    One approach – you can extend your viewengine and make it aware about specific partial view locations. I myself put all partial views in Views/Home/Partial (where Home=>controller name) folder.

     public class ViewEngine : WebFormViewEngine
        {
            public ViewEngine()
            {
                PartialViewLocationFormats = PartialViewLocationFormats
                    .Union(new[]
                           {
                               "~/Views/{1}/Partial/{0}.ascx",
                               "~/Views/Shared/Partial/{0}.ascx",
                           }).ToArray();
            }
        }
    

    But it sounds more that you are structuring your app wrong. Controller specific partial views should not render partial views that are tied with another controller. Put those partial views in shared folder.

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

Sidebar

Related Questions

I'm writing specflow tests using Watin, for an Asp.Net MVC application which uses T4MVC.
I am using T4MVC and the Chirpy plugin in an ASP.Net MVC 3 website
I'm using .NET 3.5, MVC 2 and T4MVC 2.6.42... I have the following action:
Good day! I'm using ASP.NET MVC 2 and T4MVC and it seems some code
I have an ASP.NET MVC 3 web application. I recently installed T4MVC templates by
I am using t4mvc to generate links in my project. I would like to
Yesterday I was having fully compiled ASP.NET MVC 3.0 project. Today when i opened
I have a ASP.NET MVC site and it works just fine when I run
Using ASP.NET MVC there are situations (such as form submission) that may require a
I am using T4MVC to redirect to another action return RedirectToAction(MVC.MyController.MyAction());. In result it

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.