大型项目上的 ASP.NET Razor 网页?
我即将启动一个中等规模的 Web 应用程序,并且正在考虑使用 ASP.NET Razor 语法网页框架(而不是 MVC)进行开发。但正如我所见,许多人认为“网页”是为初学者量身定制的。
我多年来一直在 ASP.NET Web 窗体中开发专业的大型 Web 应用程序,但我始终更倾向于干净的 html/javascript 代码而不是服务器端控件,因此我发现 Razor 语法非常有吸引力。我正在使用 Visual Studio,并没有考虑网页的帮助功能或其他初学者的视觉效果功能。
考虑到这一点,您对这种方法的可扩展性、速度和长期发展有何看法?
I'm on the point of starting a medium scale web application and I'm considering developing using ASP.NET Razor syntax Web Pages framework (not MVC). But as I've seen many people consider "Web Pages" to be tailored towards beginners.
I'm developing professional large scale web applications in ASP.NET Web Forms for several years now, but I've always inclined towards clean html/javascript code more than server side controls therefore I find Razor syntax very much appealing. I'm using Visual Studio and not considering web pages for helpers functions or other beginner eye candy features.
Having this in mind what are your opinions on scalability, speed, long term development on this approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就性能而言,WebPages 是 asp.net 并经过编译,因此性能应该与 WebForms 和 MVC 类似。
我想说,任何可以使用 ClassicASP、PHP 或 WebForms(不使用服务器控件)构建的网站都可以使用网页构建。
对于我的网站,我更喜欢使用网页而不是 WebForms 和 MVC。您可以完全控制 HTML,无需像 WebForms 那样担心页面生命周期和回发等概念。另一方面,您将获得一个轻量级、简单的框架,您不需要使用 VS.net、解决方案文件、项目文件和 3 个以上文件来提供单个页面,并且您不需要在之前编译整个解决方案部署方式与 MVC 不同。
但我认为你使用什么主要取决于你的详细要求和技能。
In terms of performance WebPages is asp.net and gets compliled so performance should be similar to WebForms and MVC.
I'd say that any site that could be built using ClassicASP, PHP or WebForms (without using server controls) can be built just as well using WebPages.
I prefer WebPages over WebForms and MVC for my sites. You get full control over the HTML, don't need to worry about concepts like the page lifecycle and postsbacks unlike WebForms. On the other side you get a lightweight, simple framework where you don't need to use VS.net, solutions files, project files and 3+ files to serve up a single page and you don't need to compile the entire solution before deploying unlike MVC.
But what you use I think depends mostly on your detailed requirements and skillset.
然后选择 ASP.NET MVC 3 和 Razor 视图引擎。它为您提供网页语法以及构建在 ASP.NET 等已建立平台之上的 MVC 模式的全部功能,具有可扩展性和长期开发能力。就 Microsoft 堆栈而言,您无法梦想得到更好的结果。
Go for the ASP.NET MVC 3 and the Razor view engine then. It provides you with the WebPages syntax coupled with the full power of the MVC pattern built on top of an established platform such as ASP.NET in terms of scalability and long term development. You can't dream for better as far as the Microsoft stack is concerned.