Javascript asp面板中未触发图像按钮onclick事件
我想知道为什么我的asp面板中的图像按钮onclick和onclient click事件不是fire..希望帮助..非常感谢 前端代码Javascript asp面板中未触发图像按钮onclick事件,javascript,c#,asp.net,Javascript,C#,Asp.net,我想知道为什么我的asp面板中的图像按钮onclick和onclient click事件不是fire..希望帮助..非常感谢 前端代码 <asp:Panel ID="pnlPopup" CssClass="modalPopup panel" style="display:none;" runat ="server" Width = "510px" Height ="450px" > <table class="popuptitle round" style="width
<asp:Panel ID="pnlPopup" CssClass="modalPopup panel" style="display:none;" runat ="server" Width = "510px" Height ="450px" >
<table class="popuptitle round" style="width:100%; margin:0px 0px 10px 0px;" >
<tr> <td style="width:90%;" >
Select Users
</td> <td style="text-align:right; "><asp:ImageButton ID="btnPopupX" runat="server" ImageUrl="~/images/cross.png" CausesValidation="false" AlternateText="Close" OnClick="btnPopupX_Click" /> </td></tr>
</table>
它可能不起作用,因为您实际上没有调用JavaScript函数。请尝试
OnClientClick=“hidePopup()”
(带括号)
更多信息:
注意:OP编辑了答案并删除了上面提到的代码(在本文发表时仍然是错误的)。在前端调用OnClientClick=“hidePopup()”,或者在代码隐藏文件中注册此函数
属性(“onclick”、“hidePopup()” 元素上的
mpop1
在哪里?您的意思是$find(“pnlPopup”)
?感谢您的回复…是的ajax:ModalPoppeXtender Id是mpop1@jameswilkins尝试以下操作:OnClientClick=“hidePopup()”
protected void btnPopupX_Click(object sender, ImageClickEventArgs e)
{
switch (((ImageButton)sender).ID)
{
case "btnPopupX":
txtSearch.Text = "";
loadGrid2();
break;
}
}