Sep 19, 2008, 2:41 PM
RE: Button AutoPostBack to "false"
The default value of the .AutoPostBack property on the <ext:Button> has been changed from "true" to "false".
In Visual Studio DesignMode, double clicking on the <ext:Button> will automatically wire up the "OnClick" event handler, but as with other postback enabled controls, such as <asp:TextBox>, the developer will now have to explicitly set the .AutoPostBack property to "true".
The following sample demonstrates a simple <ext:Button> which post's back to the server.
Example
<ext:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" AutoPostBack="true" />
The .AutoPostBack="true" property must be set if you are using the <ext:Button> in conjunction with an <asp:UpdatePanel> and wish to have the Button trigger the UpdatePanel to do an AsycPostBack.The following example demonstrates setting the <ext:Button> as an AsyncPostBackTrigger on the <asp:UpdatePanel>.
Example
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
</Triggers>
</asp:UpdatePanel>
<ext:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" AutoPostBack="true" />
This change to the .AutoPostBack default property value was done to encourage the use of the <AjaxEvents> (server-side) and <Listeners> (client-side> properties.The following sample demonstrates a simple <Click> AjaxEvent added to an <ext:Button>.
Example
<script runat="server">
protected void Button1_Click(object sender, AjaxEventArgs e)
{
this.Window1.Show();
}
</script>
<ext:Button ID="Button2" runat="server" Text="Submit">
<AjaxEvents>
<Click OnEvent="Button1_Click" />
</AjaxEvents>
</ext:Button>
The following sample demonstrates the same logic, but using the client-side <Click> Listener.Example
<ext:Button ID="Button2" runat="server" Text="Submit">
<Listeners>
<Click Handler="#{Window1}.show();" />
</Listeners>
</ext:Button>
Note how in both the above <AjaxEvents> and <Listeners> the .AutoPostBack property is no longer required to be set to "false".Hope this helps.