Ajaxtoolkit Popup Control Extender and javascript function

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

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
 
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
 
Back
Top