在外部库中存储编辑模板 [英] Storing Editor Templates in external library

查看:207
本文介绍了在外部库中存储编辑模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在外部库中创建的模板编辑器,使他们可以在应用程序之间共享?我并不想CSHTML文件存储在库中,只是想知道如果有,您可以创建它们,并将它们存储喜欢你的HTML助手做的一种方式。有几个,我使用了很多,这将是不错的他们都在一个单一的库引用。

Is it possible to create Editor Templates in an external library so that they can be shared between applications? I'm not looking to store cshtml files in a library, just wondering if there was a way you can create them and store them like you do with html helpers. There are a few that i use quite a lot and it would be nice to have them all in a single library to reference.

推荐答案

MVCContrib便携式领域提供了这个功能。开箱即用的有什么内置。您将需要推出定制的VirtualPathProvider如果你想嵌入的意见到一个单独的组件。您也可以找到的以下博客帖子有用的。

MVCContrib Portable Areas offers this functionality. Out of the box there is nothing built-in. You will need to roll your custom VirtualPathProvider if you wanted to embed views into a separate assembly. You may also find the following blog post useful.

这篇关于在外部库中存储编辑模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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