在 Web 服务器控件中,某些事件(通常是 Click 事件)会导致窗体被回发到服务器。HTML 服务器控件和 Web 服务器控件(如 TextBox 控件)中的更改事件将被捕获,但不会立即导致发送。相反,它们会被该控件缓存,直到发送再次发生时为止。然后,当再次在服务器上处理该页时,将引发并处理所有的挂起事件。支持更改事件的 Web 服务器控件包含 AutoPostBack 属性。当此属性为 true 时,控件的更改事件会导致立即发送窗体,而不等待 Click 事件。例如,默认情况下,CheckBox 控件的 CheckedChange 事件不会导致该页被提交。但是,通过将该控件的 AutoPostBack 属性设置为 true,可以指定当用户单击复选框时,立即将该页发送到服务器进行处理。

解决方案 »

  1.   

    he is asking about AutoEventWireup, not AutoPostBack, here is from the documentation:http://msdn.microsoft.com/library/en-us/vbcon/html/vbconwebformseventmodel.asp"...
    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.
    ..."
      

  2.   

    ...
    设置为True时,Page的事件会自动关联到支持的方法:
    例如void Page_Load()
    {
    }能自动关联。