Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to render a partial view from another project

I'm trying to render a partial view from another project.

It's very simple. I've highlighted the string where should be replace for the _View1 since the another one.

What do I need to add to the string to recognize and access to the razor partial view?

enter image description here

like image 824
Darf Zon Avatar asked Feb 27 '26 12:02

Darf Zon


1 Answers

It's not supported in ASP.NET MVC per default.

You have to create a custom VirtualPathProvider which can locate your views. You also have to use @inherit instead of @model.

Or you can use my open source MvcContrib project as I describe here: http://blog.gauffin.org/2012/05/griffin-mvccontrib-the-plugin-system/

(the code is located at github + nuget: https://github.com/jgauffin/griffin.mvccontrib)

like image 174
jgauffin Avatar answered Mar 02 '26 13:03

jgauffin