为什么asp.net包裹页面的形式? [英] Why does asp.net wrap the page in a form?

查看:104
本文介绍了为什么asp.net包裹页面的形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个PHP开发谁拥有对ASP.net项目的工作,我不知道为什么每个页面被包裹在一种形式。这只是没有任何意义,我。

I'm a PHP developer who has to work on ASP.net projects and I'm wondering why every page is wrapped in a form. This just doesn't make sense to me.

亦是与所有的隐藏输入字段尤其是在视图状态之一。

Also What's with all the hidden input fields especially the "View State" one.

推荐答案

ASP.Net试图让这个程序员可以pretend该网络是一个平台状态,而且它的行为像一个桌面应用程序。视图状态基本上是页面的状态的序列化块生成时。当页被发送回服务器端模型被初始化到ViewState中的值,然后从形式发布新的值被应用。

ASP.Net tries to make it so that the programmers can pretend that the web is a stateful platform, and that it behaves like a desktop application. The ViewState is basically a serialized block of the state of the page when it was generated. When the page gets posted back the server side model gets initialized to the values in ViewState, and then the new values from the posted form are applied.

成为一个体面的ASP.Net程序员部分是,当使用ViewState的,而不是学习,因为默认是无处不在,导致了大量的膨胀在下载页面中使用它。

Part of becoming a decent ASP.Net programmer is learning when to use ViewState and not, because the default is to use it everywhere which causes a lot of bloat in the downloaded page.

这篇关于为什么asp.net包裹页面的形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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