在类库中包含视图 [英] Including Views in a Class Library

查看:17
本文介绍了在类库中包含视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上一个问题中,我发现了如何创建一个MVC 的插件架构.我还没有完全走上这条路,但我确实有一个很好的拆分方法.

In a previous question I found out how to create a plugin architecture for MVC. I'm not the whole way down that path yet but I do have a nice way of splitting things up.

让我烦恼的一件事是视图在类库中时的智能感知.在核心 MVC 项目中开发它们,然后将它们复制过来很痛苦.

One thing that is bugging me though is the intellesense for the View when they are in the Class Library. Developing them in the core MVC project and then copying them across is a pain.

基本上我遇到的问题是我不太了解 Visual Studio 如何处理 aspx 文件.我目前在 Beta 版上,我想我可以利用 RC1 附带的显式视图构建.

Basically the problem that I'm having is that I don't understand well enough how Visual Studio is dealing with the aspx files. I'm on Beta at the moment, I'm thinking that I might be able to take advantage of explicit view building that comes with RC1.

任何帮助将不胜感激.

更新:

当它实际运行时,我已经整理了所有视图的发现,它在我感兴趣的 Visual Studio 中编辑它们.它们必须在网络类型项目中吗?

I have all of the finding of views sorted out when it is actually running, its the editing of them in visual studio I'm interested in. Do they have to be in a web type project?

推荐答案

视图可以随心所欲.有一个 ViewLocator,您可以替换它并将它们放在您喜欢的任何位置:http://blogs.teamb.com/craigstuntz/2008/07/31/37827/.

The views can be whereever you like. There's a ViewLocator and you can replace it and put them wherever you like: http://blogs.teamb.com/craigstuntz/2008/07/31/37827/.

如果您觉得满意,您可以将它们放入二进制文件或数据库中.

You could put them in a binary or in a database if it made you happy.

这篇关于在类库中包含视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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