内容简介:翻译自:https://stackoverflow.com/questions/5276180/i-cant-click-on-an-aspbutton-if-it-is-hidden-using-jquery
我找到了StackOverFlow的答案和其他资源,说你可以点击一个隐藏的ASP:按钮与jQuery by
$("#<%=HiddenButton.ClientID%>").click();
要么
$("#<%=HiddenButton.ClientID%>").trigger("click");
但是,这些都不适用于我,除非按钮是Visible =“true”
这是按钮:
<asp:Button ID="loadCustomerContacts" runat="server" OnClick="loadCustomerContacts_Click" visible="false" />"
如果将Visible属性设置为false;通常在.net中,在处理页面后,控件不会在HTML输出中呈现.因此,就jQuery而言,该按钮不存在.
您可以在页面上执行查看源来验证这一点.
如果您想这样做,而不是使用Visible属性,您可以执行以下操作:
<asp:Button ID="myButton" runat="server" style="visibility: hidden; display: none;" />
或者你可以为它分配一个隐藏它的CSS类.
翻译自:https://stackoverflow.com/questions/5276180/i-cant-click-on-an-aspbutton-if-it-is-hidden-using-jquery
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- javascript – 模糊事件未触发 – 无法找到处理隐藏模糊文本字段的变通方法
- 揭开隐藏算法的神秘面纱
- 2B产品的隐藏陷阱:销售驱动
- 应急响应之 Linux 下进程隐藏
- 隐藏在浏览器背后的 “黑手”
- java遗珠之隐藏和覆盖
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Remote
Jason Fried、David Heinemeier Hansson / Crown Business / 2013-10-29 / CAD 26.95
The “work from home” phenomenon is thoroughly explored in this illuminating new book from bestselling 37signals founders Fried and Hansson, who point to the surging trend of employees working from hom......一起来看看 《Remote》 这本书的介绍吧!