Button AutoPostBack to "false"

Page 2 of 2 FirstFirst 12
  1. #11

    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" &#111;nclick="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" &#111;nclick="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.
    Geoffrey McGill
    Founder
  2. #12

    RE: Button AutoPostBack to "false"

    Cool... Making the simple tasks even simpler... Thanks...

    Any news on 6.0 release? Or possible to have latest build from SVN?

    Thanks,
Page 2 of 2 FirstFirst 12

Similar Threads

  1. radio button always returns false
    By khadga in forum 1.x Help
    Replies: 4
    Last Post: Nov 20, 2010, 7:37 AM
  2. radio button always return false
    By hector_toy82 in forum 1.x Help
    Replies: 0
    Last Post: Nov 17, 2010, 7:11 PM
  3. Radio button values always shows false
    By vs.mukesh in forum 1.x Help
    Replies: 0
    Last Post: Jul 01, 2010, 3:52 PM
  4. TabPanel and autopostback button
    By kritter in forum 1.x Help
    Replies: 1
    Last Post: Jan 11, 2010, 9:05 PM
  5. Set button visible to false
    By glenh in forum 1.x Help
    Replies: 2
    Last Post: Aug 24, 2009, 10:44 AM

Posting Permissions