PopupControlExtender ImageButton problem (full postback)

Last post 08-01-2007 2:53 AM by Javier Luna. 3 replies.

Sort Posts:

  • PopupControlExtender ImageButton problem (full postback)

    02-16-2007, 1:31 PM
    • Member
      12 point Member
    • ppoulos
    • Member since 01-22-2007, 8:48 PM
    • Athens, Greece
    • Posts 20

    Hi everyone,

    I suspect this topic has been touched upon before, from various angles, however as I couldn't find a satisfying answer I'll go ahead and post it again. Bare with me if you've seen this before:

      <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:TextBox ID="TextBox1" runat="server" Width="80">
        </asp:TextBox>
        <asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
          <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
              <asp:ImageButton ID="btnImage" runat="server" />
              <asp:LinkButton ID="btnLink" runat="server" Text="Click me!">
              </asp:LinkButton>
            </ContentTemplate>
          </asp:UpdatePanel>
        </asp:Panel>
        <ajaxtoolkit:PopupControlExtender ID="PopupControlExtender1" runat="server" PopupControlID="Panel1"
          Position="Bottom" TargetControlID="TextBox1">
        </ajaxtoolkit:PopupControlExtender>
      </form>
    

    The behaviour I experience with the latest Ajax release (v1.0) and the latest AjaxControlToolkit is this:

    1. When the popup panel appears, pressing the ImageButton will perform a full postback (not async) even though it resides in an UpdatePanel.
    2. The LinkButton works as expected, ie. performs an async postback.
    3. After pressing the LinkButton once, the ImageButton then performs async postbacks, but its handler is never called.

    Now some people have suggested setting the UseSubmitBehavior property to false for Buttons, which makes sense, but will not work for ImageButtons.

    Is there a resolution for this issue, or any ideas for a workaround?

    Thanks

    Filed under:
  • Re: PopupControlExtender ImageButton problem (full postback)

    02-19-2007, 5:08 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-11-2006, 1:39 AM
    • Microsoft
    • Posts 1,842
    Instead of an ImageButton, wrap an Image in a HyperLink?

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: PopupControlExtender ImageButton problem (full postback)

    02-20-2007, 2:47 AM
    • Member
      12 point Member
    • ppoulos
    • Member since 01-22-2007, 8:48 PM
    • Athens, Greece
    • Posts 20

    David

    Thanks for replying, unfortunately I need to trigger a postback not link to another page (I also don't want to use query strings). The solution I'm using temporarily is have a LinkButton under the Image, then in the code-behind attach an 'onclick' attribute on the Image which calls javascript:click() on the LinkButton. This appears to work.

    Can I ask you guys, is this an issue with PopupControlExtender (which we can expect to be fixed) or perhaps a design limitation (which we can't expect to be fixed) ?

    Thanks again!

  • Re: PopupControlExtender ImageButton problem (full postback)

    08-01-2007, 2:53 AM
    Answer
    • Contributor
      2,426 point Contributor
    • Javier Luna
    • Member since 08-29-2006, 12:34 PM
    • Lima, Peru
    • Posts 592

    ppoulos:

    David

    Thanks for replying, unfortunately I need to trigger a postback not link to another page (I also don't want to use query strings). The solution I'm using temporarily is have a LinkButton under the Image, then in the code-behind attach an 'onclick' attribute on the Image which calls javascript:click() on the LinkButton. This appears to work.

    Can I ask you guys, is this an issue with PopupControlExtender (which we can expect to be fixed) or perhaps a design limitation (which we can't expect to be fixed) ?

    Thanks again!

    You would have to use ImageButton's OnClientClick property

    OnClientClick="this.disabled=true;__doPostBack(this.name,'');"

    from Villa El Salvador for world!
Page 1 of 1 (4 items)