在MVC中创建皮肤引擎
有人有为 ASP.NET MVC 创建皮肤引擎的经验吗?我知道建议的方法是使用灵活的 CSS 标记,但我希望能够添加新视图,并且应用程序使用该视图而不是默认视图。
基本上,我想知道如何告诉框架(在运行时)查看视图/内容的特定文件夹,以及该项目是否不存在来检查默认位置。
我开始研究 Oxite 博客引擎是如何做到这一点的,但似乎这对于我的需要来说可能有点多(我仍在浏览它,所以我可能是错的。)感谢任何帮助。
Does anyone have any experience creating a skin engine for asp.net MVC? I know the suggested approach is to use flexible markup with CSS, but I would like the ability for a new view to be dropped in, and the application use that one instead of the default one.
Basically, I want to know how to tell the framework (at run time) to look into a specific folder for the views/content, and if the item isn't there to check the default locations.
I started to look into how the Oxite blog engine does it, but it seems like that might be a bit much for what I need (I am still looking through it, so I could be wrong.) Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要稍微更改一下 ViewEngine。
请参阅这篇文章 http://bartreyserhove.blogspot.com /2009/02/building-multi-tenant-applications-with_22.html
也可以对部分页面和母版页执行此操作。
You need to change the ViewEngine a little bit.
See this post http://bartreyserhove.blogspot.com/2009/02/building-multi-tenant-applications-with_22.html
It can be done for partials and masterpage also.