将编辑器模板存储在外部库中
是否可以在外部库中创建编辑器模板,以便可以在应用程序之间共享它们?我不想将 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.