简体   繁体   English

使用jQuery在mouseenter上触发asp.net linkbutton的click事件

[英]Trigger the click event of asp.net linkbutton on mouseenter using jQuery

I am trying to trigger a click event on hover using jQuery. 我试图使用jQuery在悬停时触发click事件。

This is pretty simple but it would seem I can not trigger the click of an asp.net linkbutton which refreshes the content of an updatepanel using this method. 这很简单,但似乎我无法触发使用此方法刷新updatepanel内容的asp.net linkbutton的点击。

Here's the code - fairly standard so not sure it will make a difference. 这是代码 - 相当标准,所以不确定它会有所作为。

$("a.testbutton").mouseenter( function() {
    $(this).trigger('click');
});

Any ideas? 有任何想法吗?

Programmatically triggering click differs from actual click event, try the following. 以编程方式触发点击与实际点击事件不同,请尝试以下操作。

$("a.testbutton").mouseenter(function() {
    window.location.href = this.href
});

Have you tried 你有没有尝试过

$("a.testbutton").mouseenter( function() {
    $(this).click(function(alert();)) //replace alert(); with your refresh function
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 LinkBut​​ton 单击事件未触发 asp.net - LinkButton click event not firing asp.net 使用JavaScript执行ASP.NET回发(单击LinkBut​​ton) - 发生回发但不发生Click事件 - Using JavaScript to do ASP.NET postback (clicking LinkButton) - postback occurs but not Click event 用JavaScript触发asp.net LinkBut​​ton - Trigger an asp.net LinkButton with javascript asp.net链接按钮和jQuery模式弹出 - asp.net linkbutton and jquery modal pop 如何在asp.net中使用jQuery触发ListView内部的按钮单击事件? - how to trigger button click event inside listview with jquery in asp.net? 在asp.Net LinkBut​​ton OnClientClick上触发html5表单验证 - Trigger html5 form validation on asp.Net LinkButton OnClientClick 如何通过单击另一页面的链接按钮来调用按钮的单击事件,而无需在c#ASP.NET中回发 - How to call button's click event from click of linkbutton of another page without post back in c# ASP.NET 是否可以打开<asp:dropdownlist>使用<asp:linkbutton>在 ASP.NET 上?</asp:linkbutton></asp:dropdownlist> - Is it possible to open <asp:DropDownList> using <asp:LinkButton> on ASP.NET? ASP.NET linkbutton两次提高onBeforeUnload事件 - ASP.NET linkbutton raising onBeforeUnload event twice jQuery触发器asp.net单选按钮在更新面板内部单击 - jQuery trigger asp.net radiobutton click inside of update panel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM