在 Web 服务器控件中,某些事件(通常是 Click 事件)会导致窗体被回发到服务器。HTML 服务器控件和 Web 服务器控件(如 TextBox 控件)中的更改事件将被捕获,但不会立即导致发送。相反,它们会被该控件缓存,直到发送再次发生时为止。然后,当再次在服务器上处理该页时,将引发并处理所有的挂起事件。支持更改事件的 Web 服务器控件包含 AutoPostBack 属性。当此属性为 true 时,控件的更改事件会导致立即发送窗体,而不等待 Click 事件。例如,默认情况下,CheckBox 控件的 CheckedChange 事件不会导致该页被提交。但是,通过将该控件的 AutoPostBack 属性设置为 true,可以指定当用户单击复选框时,立即将该页发送到服务器进行处理。
解决方案 »
- 数据库字段类型转换问题
- 如何在datagrid中显示数据的时候,改变记录行的颜色(vb脚本实现)?
- 奇怪的问题,把源代码转到另一个机子上,很多调好的功能就会失去?????感觉它不响应事件啦!
- 怎么使我的ASP.NET的数据库自动和某URL数据库保持同步?
- 怎么在textbox设置才能防止脚本注入攻击呢?
- 数据源是存储过程是DataGrid的分页问题??????
- asp.net mvc3 IE7以下版本不支持Ajax问题?
- NPOI导出Excel设置密码保护问题!!!
- 大家来探讨一下框架网页中的word显示问题
- 如何得到这个函数的返回值?
- 如何手工调用一个按扭的点击事件
- asp.net是用C#火还是VB.NET火??
The ASP.NET page framework also supports an automatic way to associate page events and methods. If the AutoEventWireup attribute of the Page directive is set to true (or if it is missing, since by default it is true), the page framework calls page events automatically, specifically the Page_Init and Page_Load methods. In that case, no explicit Handles clause or delegate is needed.The disadvantage of the AutoEventWireup attribute is that it requires that the page event handlers have specific, predictable names. This limits your flexibility in how you name your event handlers.
..."
设置为True时,Page的事件会自动关联到支持的方法:
例如void Page_Load()
{
}能自动关联。