ASP.NET MVC不ViewState的回传和工作? [英] ASP.NET MVC doesn't work with ViewState and Postback?

查看:141
本文介绍了ASP.NET MVC不ViewState的回传和工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许这是一个幼稚的问题。在我的理解,ASP.NET MVC无法与ViewState的回发和这是ASP.NET表单基础工作。这是否正确?

Perhaps this is a naive question. In my understanding, ASP.NET MVC cannot work with ViewState and Postback which is fundamentals of ASP.NET forms. Is that correct?

如果仅此而已,然后根据的ViewState&放所有的ASP.NET Web控件;回发不能在ASP.NET MVC中使用,对吧?

If that's it, then all ASP.NET Web Controls depending on ViewState & Postback cannot be used in ASP.NET MVC, right?

推荐答案

ASP.NET的服务器端控件与的WebForms,而不是MVC工作。 MVC不会在传统的ASP.NET意义上使用的控制(至少还)。

ASP.NET's server-side controls work with WebForms, not MVC. MVC doesn't use controls in the traditional ASP.NET sense (at least yet).

MVC模式是从WebForms的模式完全不同;没有更好或更坏,但非常不同。使用MVC使开发人员更接近生成的HTML,本质上更适合于单元测试,并提供用于填充的UI用户界面和code之间的关注强烈的分离。

The MVC model is quite different from the WebForms model; not better or worse, but very different. Using MVC puts the developer much closer to the generated HTML, lends itself more intrinsically to unit testing, and provides a strong separation of concerns between the UI and the code that populates that UI.

乍一看,特别是要强化ASP.NET退伍军人,MVC似乎是倒退了一大步(如果你已经被编码以后,ASP COM发展的愿景可能会在你的头上跳舞)。

At first glance, especially to hardened ASP.NET veterans, MVC can seem like a huge step backwards (if you've were coding then, visions of ASP COM development might dance in your head).

但给MVC一试。这是非常有趣,它的型号是颇为引人注目,一旦你习惯了它。

But give MVC a try. It is very interesting and its model is quite compelling once you get used to it.

在这里阅读更多:
<一href=\"http://quickstarts.asp.net/$p$pviews/mvc/mvc_HowToRenderFormUsingHtmlHelpers.htm\">http://quickstarts.asp.net/$p$pviews/mvc/mvc_HowToRenderFormUsingHtmlHelpers.htm

此外,检查出使用MVC这个有趣的博客引擎:
HTTP://www.$c$cplex.com/oxite

Also, check out this interesting blog engine that uses MVC: http://www.codeplex.com/oxite

最后,检查出罗布科纳的MVC店面项目:
<一href=\"http://wekeroad.com/category/mvc-storefront\">http://wekeroad.com/category/mvc-storefront

Finally, check out Rob Conery's MVC storefront project: http://wekeroad.com/category/mvc-storefront

这篇关于ASP.NET MVC不ViewState的回传和工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆