需要参考 ASP.net MVC 视图标记语法

发布于 2024-07-30 17:59:30 字数 345 浏览 6 评论 0原文

我正在开始使用 .NET MVC。 我有使用 C# 的经验,并且对控制器和模型越来越熟悉。 然而,在撰写观点方面我不太了解。 我正在努力寻找关于此事的良好参考。 可用的代码示例通常很简单,并且旨在演示整个 MVC 模型。 我发现可用的网络表单参考由于事件驱动控件的混合而令人困惑。

在哪里可以找到有关专门为 .NET MVC 编写视图的良好参考资料? 我正在寻找书籍、在线参考资料,甚至只是真正完整的示例代码。

谢谢

PS 我假设使用默认的 microsoft aspx/ascx <% %> 样式语法是要走的路(至少开始是这样)。 如果有我需要考虑的重要替代方案,请告诉我。

I'm getting started with .NET MVC. I have experience with C# and I'm getting confortable with controllers and models. I'm however not very knowledgeable when it comes to writing views. I'm struggling to find a good reference on the matter. Available code samples are usually simple and oriented towards demonstrating the overall MVC model. I find available webforms references confusing because of the mixture of event driven controls.

Where can I find a good reference on writing views specifically for .NET MVC? I'm looking for either books, online references or even just really complete sample code.

Thanks

PS I'm assuming that using the default microsoft aspx/ascx <% %> style syntax is the way to go (at least to start). Please let me know if there's important alternatives I need to consider.

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

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

发布评论

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

评论(2

情场扛把子 2024-08-06 17:59:30

您应该熟悉 NerdDinner HTML 教程。 它为您提供了关于在 MVC 上构建应用程序的整个过程的出色概述,包括一些相当复杂的场景。

该示例摘自一本名为 Professional ASP.NET MVC 1.0 的书; 我也会推荐它,而且如果您愿意的话,它还提供 Kindle 格式想。 这本书包含许多有趣的章节,涉及大量 MVC 主题,也涉及视图。

<%%> 语法就是您想要的,尽管存在替代视图引擎,正如另一个答案中已经提到的那样。 但在您非常熟悉 ASP.NET MVC 之前,我建议您坚持使用基本视图引擎 - 最容易找到相关帮助和示例。

我建议您从上述参考文献开始,然后针对您觉得不舒服的部分提出更具体的问题。 希望这可以帮助 :-)

You should acquaint yourself with the NerdDinner HTML tutorial. It gives you an excellent overview of the entire process of building an app on MVC, including some rather complex scenarios.

The sample is an excerpt from a book called Professional ASP.NET MVC 1.0; I'll recommend that too, and it's also available in Kindle format if you want. The book contains quite a few interesting chapters on a multitude of MVC subjects, also about views.

The <% %> syntax is what you want, although alternative view engines exist as already mentioned in another answer. But until you're well familiar with ASP.NET MVC, I would recommend sticking with the basic view engine - it's easiest to find help and samples for that.

I suggest you start with the above references and then ask more specific questions on the parts you don't feel comfortable with. Hope this helps :-)

屋檐 2024-08-06 17:59:30

ASP.NET MVC 有替代视图引擎。

NHamlSpark NVelocityBrail

也查看 MVC Contrib 项目。 它包括几个视图引擎。

MvcContrib 现在为 ASP.NET MVC 提供四 (4) 个替代视图引擎

There are alternative view engines for ASP.NET MVC.

NHaml, Spark, NVelocity, Brail

Also have a look at the MVC Contrib project. It includes several view engines.

MvcContrib now offers four (4) alternative view engines for ASP.NET MVC

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