ASP.NET:Web 开发选择
我一直在学习使用 ASP.NET MVC 2 来开发网站……在此之前,我从未在 .NET 环境中进行过开发。自从我开始使用 MVC 以来,老实说我不知道如何使用 ASP.NET 开发网站。
我到处听说过“WebForms”,但并没有真正理解其中的区别。但是,除此之外,ASP.NET 还有哪些其他 Web 开发方法呢?
我知道,这一切都非常落后……但如果您能幽默一下,或许列出利用 C# 开发出色的 Web 应用程序的不同方法,那将非常有用。
I have been learning to develop websites using ASP.NET MVC 2 for work... and previous to this, I had never developed within an .NET environment before. Since I jumped right into using MVC, I honestly have no idea how else to develop websites with ASP.NET.
I've heard about "WebForms" here and there, but don't really get the difference. But, beyond that, what other means of web development is there with ASP.NET?
It's all very backwards, I know... but if you can just humor me and perhaps list the different ways of utilizing C# to develop great web applications, that would be extremely useful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ASP.NET 是开发 .NET Web 应用程序的平台。
该平台之上有两种技术可供选择:
Web 窗体使用 WinForms 风格的开发 - 拖/放、事件处理程序、页面生命周期、ViewState 的状态性 - 在我看来,所有这些都是邪恶的。
如您所知,MVC 没有页面生命周期,没有事件处理程序,没有服务器控件(可以,但不推荐/要求),没有 ViewState。
我真的不知道我还能说些什么,而无需透露太多细节。
这两种技术将继续得到支持/增强。
但由于您已经精通 ASP.NET MVC - 我认为学习 Web 表单没有任何好处。如果有的话,这将是一个退步。
至于这个说法:
这有点太宽泛/主观了。
什么是“伟大”?表现好不好?看起来不错吗?可维护吗?上述所有的?
毫无疑问 - MVC 在大多数事情上会比 Web 表单做得更好。
Web 表单应用程序唯一可行的选择可能是需要大量复杂网格/控件的 Intranet 应用程序,并且不需要 SEO/AJAX 之类的东西。
IMO 中其他所有事情都应该在 MVC 中完成。
ASP.NET is the platform for developing .NET web applications.
Sitting on top of that platform is two technologies to choose from:
Web Forms uses WinForms-style development - drag/drop, event handlers, page lifecycle, statefulness with ViewState - all things evil in my opinion.
MVC as you know has no page lifecycle, no event handlers, no server controls (you can, but not recommended/required), no ViewState.
Don't really know what else i can say without going into too much detail.
Both technologies will be continued to be supported/enhanced.
But since your already versed in ASP.NET MVC - i seen no benefit in learning Web Forms. It would be a step back if anything.
As for this statement:
That's a bit too broad/subjective.
What is "great"? Well performing? Looks good? Maintainable? All of the above?
No doubt - MVC will do a better job at most things than Web Forms.
Only feasible choice for a Web Forms app might be a intranet application where tons of complex grids/controls are required, and things like SEO/AJAX is not required.
Everything else should be done in MVC IMO.