请帮助我了解ASP.NET控件的AutoPostBack属性 [英] Please help me understand AutoPostBack property of an ASP.NET control

查看:126
本文介绍了请帮助我了解ASP.NET控件的AutoPostBack属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习ASP.NET,主要是通过一本书之后,又作出努力,实际上做的事情沿途。但是,我遇到了我所不明白的列表控件的解释。这是这样说的:

I'm learning about ASP.NET, mainly by following through a book, but also making an effort to actually do things along the way. But, I came across an explanation about list controls which I don't understand. This is what it says:

[在智能任务面板的情况下] ... 的最后一个选项设置控件的AutoPostBack属性。选中该选项时,控制系统将提交它包含在返回给服务器页面一旦用户从列表中选择一个新项目

"[in the context of the Smart Tasks panel]...the last option sets the AutoPostBack property of the control. With this option checked, the control will submit the page it's contained in back to the server as soon as the user chooses a new item from the list"

您能解释一下这句话给我吗?在此先感谢您的帮助。

Can you explain this statement for me? Thanks in advance for your help.

推荐答案

对于普通的客户端控件(如用的AutoPostBack 列表控件设置为),当用户在列表中选择一个项目,该浏览器的不可以与服务器进行通信。有没有网络流量,并为您的用户没有延迟他们看到选择的结果之前,但也有没有机会做任何事情在你的服务器code,如计算相关值。如果你想做的任何事情在屏幕响应的选择,你必须使用一个客户端脚本。

For normal client controls (such as a list control with AutoPostBack set to false), when a user chooses an item in the list, the browser does not communicate with the server. There's no network traffic and no delay for your user before they see the results of the choice, but there's also no opportunity to do anything in your server code, like calculate dependent values. If you want to do anything to the screen in response to the choice, you have to use a client-side script.

的AutoPostBack 设置为真正,在列表中选择一个项目将消息发送到服务器(通过一个 HTTP POST )。 ASP.NET然后执行您已连接到列表中的更改事件无论code,重建页面,并将修改后的页面到客户端。

When AutoPostBack is set to true, selecting an item in the list sends a message to the server (via an HTTP POST). ASP.NET then executes whatever code you have attached to the list's changed event, rebuilds the page, and sends the revised page to the client.

这篇关于请帮助我了解ASP.NET控件的AutoPostBack属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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