Ajaxtoolkit Popup Control Extender and javascript function

Discussion in 'ASP .Net' started by tshad, May 13, 2008.

  1. tshad

    tshad Guest

    I am trying to use a popup control extenter which works fine the following
    way where we have an object and a popcontrolextender objec that points to
    this object.

    <asp:ImageButton ID="ibPractitioners" runat="server"
    ImageUrl="~/images/icons/user_16.gif"
    ToolTip="Display Practitioners" Visible='<%#
    Convert.ToBoolean(Eval("PractitionersVisible")) %>'
    CommandName="practitioners" CssClass="action" />

    <cc1:popupControlExtender ID="mPopupControlExtender" runat="server"
    TargetControlID="ibPractitioners"
    PopupControlID="pnlPractitioners" />

    The problem is I need to add a onClientClick event and this doesn't get
    called when the extender is tied to it:

    <asp:ImageButton ID="ibPractitioners" runat="server"
    ImageUrl="~/images/icons/user_16.gif"
    ToolTip="Display Practitioners" Visible='<%#
    Convert.ToBoolean(Eval("PractitionersVisible")) %>'
    CommandName="practitioners" CssClass="action"
    onClientClick="logName(this)"/>

    Here logName(this) never gets called.

    I want this function to be called before the popup extender so I can log
    this action.

    Is there a way to do this?

    Thanks,

    Tom
     
    tshad, May 13, 2008
    #1
    1. Advertisements

  2. tshad

    tshad Guest

    I just found out that not only does it disable the onClientClick event of
    the TargetControl, but also others. In this case, my images are in a
    DataList and the OnItemCommand does not fire for the icon that has the PCE
    connected to it. All the others fire fine. As soon as I point the
    TargetControlID at a different image, the event will not fire for that one
    but now it will for the one that didn't work before.

    Why is this?

    Thanks,

    Tom
     
    tshad, May 15, 2008
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.