MVC 区域感知主题

发布于 2024-10-16 17:53:41 字数 689 浏览 5 评论 0 原文

我是 MVC 新手,但正在努力寻找解决方法。我目前正处于这样的阶段:我知道的足够危险,但还不足以真正做任何有用的事情。

我正在建立一个网站,我希望它能够非常灵活地“换肤”。它最终也可能会很大,所以我真的想使用区域。

我正在考虑让自己陷入困境,看看是否可以构建一个既具有区域感知又具有主题支持的自定义视图引擎。我想这是这两篇文章的混合体。

在我开始之前 - 而且更重要的是 - “在我开始、脱发、完成、实施和构建我的大型应用程序之前”,如果有人认为这是一个好主意,可以发表评论吗?

我只是想知道是否有一个图书馆已经做到了这一点,或者是一种我完全缺少的更简单的方法......

非常欢迎任何建议!

预先感谢,

Z

I'm new to MVC but am working hard to find my way through it. I'm currently at the point where I know enough to be dangerous, but not quite enough to actually do anything useful.

I'm building a site which I'd like to be very flexibly "skinable". It could also end up quite large, so I really want to use areas.

I'm thinking of throwing myself in the deep end and seeing if I can build a custom view engine that is both area aware and has theme support. I guess that it's kind of a hybrid of these two articles.

Before I start - and also, more to the point - "before I start, lose hair, finish, implement and build my massive app on it", can anyone comment if they think that this is a good idea?

I'm just wondering if there's a library out there that already does this, or a much easier way that I'm completely missing...

Any suggestions most welcome!!

Thanks in advance,

Z

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

戈亓 2024-10-23 17:53:42

如果你要做某事,通常最好有一个充分的理由去做这件事。

如果您的目标是启用主题,最简单的方法是在 viewData 中设置主题,并让自定义 HtmlHelper 根据 viewdata 的主题键包含必要的 .css 和 .js 引用。

为了获得更强大的解决方案,Telerik 有 ASP.NET MVC 的开源扩展,这对于开发 UI 并启用主题功能非常有用:http://demos.telerik.com/aspnet-mvc 。使用他们的入门套件可能会节省您很多时间。

If you're going to do something, it's generally a good idea to have a good reason to do it.

If you're objective is to enable themes, the easiest way to do this is to set the theme in viewData and have a custom HtmlHelper include the necessary .css and .js references based on the viewdata's theme key.

For a more robust solution, Telerik has an open source extension of ASP.NET MVC, which is very useful for developing your UI and enables theme-functionality : http://demos.telerik.com/aspnet-mvc . Using their starter kit would probably save you a good bit of time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文