将部分视图从一个项目渲染到另一个项目 [英] Render Partial view from one project to another

查看:87
本文介绍了将部分视图从一个项目渲染到另一个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我的解决方案有4个项目。在这里,我想从Project4调用一个部分视图到project1 ...这里使用的是dll方法。使用project4 dll作为project1的参考..但仍然无法工作..



谢谢

DK

Hi All,

My Solution having 4 projects. here i wanna call one partial view from Project4 to project1... here am using dll method. using project4 dll as reference for project1.. but still not working..

Thanks
DK

推荐答案

使用DLL无法正常工作。部分视图只是一个HTML页面吗?

在这种情况下,所有项目1到4都有一个单独的MVC项目和每个项目创建区域。项目1区域为项目2,...等等。在共享文件夹内的主MVC项目中保留您的局部视图并在任何需要的地方使用它。

如果所有这四个项目都不能在一起,由于一些约束,那么创建一个单独的MVC项目可以作为所有这四个项目的共同平台。

所有这些都是替代方案。只是通过使用DLL,您无法将HTML页面(部分视图)从一个项目传递到另一个项目。
It will not work using DLL. Partial view is nothing but a HTML page right ?
In this case for all project 1 to 4 have inside a Single MVC project and for each of these project create areas. Area for Project 1 area for Project 2,...and so on. On the Main MVC project inside Shared folder keep your partial view and use it wherever you need it.
If All these four project can not be clubbed together, because of some constraint then create a separate MVC project which can be act as a common platform for all these four projects.
Again all these are alternatives. Just by using DLL you can not pass a HTML page(partial view) from one project to another project.


这篇关于将部分视图从一个项目渲染到另一个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆