按钮上的BlockUI jQuery单击 [英] BlockUI jQuery on Button click

查看:98
本文介绍了按钮上的BlockUI jQuery单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

答案:此问题的解决方法是:

ANSWER: The fix for this problem is this :

将选择器从$('#Button3')更改为$('#<%= Button3.ClientID %>')

感谢Yuri.

问题:

我正在尝试获取按钮click来运行 JQuery BlockUI插件.我遇到了一些问题,这是我在JQuery上的第一枪.我确实有Hello World弹出示例的工作,所以我想我很亲近,但可以使用一些帮助来解决其余问题.

I am trying to get a button click to run the JQuery BlockUI plugin. I am having some issues this is my first shot at JQuery. I do have the Hello World pop-up example working so I think I am close but could use some help getting the rest worked out.

这是代码...

<script src="../../scripts/jquery-1.2.6.js" type="text/javascript"></script>
<script src="../../scripts/jquery.blockUI.js" type="text/javascript"></script>

<script type="text/javascript">
 $(document).ready(function() {
     $("#Button3").click(function() {
     $.blockUI();

     setTimeout(function() {
         $.unblockUI({
             onUnblock: function() { alert('onUnblock'); }
         });
     }, 2000);
   });
});

</script>

我正在尝试在aspx页面上运行它.如前所述,Hello World弹出窗口有效,但blockUI无效.

I am trying to run this on an aspx page. As stated the Hello World popup works but not the blockUI.

任何帮助将不胜感激.

这是按钮aspx ...

Here is the button aspx...

 <td>
      <asp:Button ID="Button3" runat="server" Text="Button" />
  </td>

按钮上的事件背后没有代码.

no code behind events on the button.

此apsx页面也具有母版页面.

This apsx page has a Master Page as well.

在Visual Studio中关闭页面时,对代码的某些调整导致了此错误...

Some tweaks to the code have prodcued this error when closing the page in Visual Studio...

Microsoft JScript运行时错误:Sys.ArgumentTypeException:的对象 类型"Sys._Application"无法转换为类型 '系统_应用程序'.参数名称:实例

Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'. Parameter name: instance

推荐答案

首先,您必须阻止UI.那么它只会被解除阻止.您不能取消阻止未被阻止的内容,例如 unblocked == notblocked .

First you have to block the UI. then only will it be unblocked. You cannot unblocked something that is not blocked as unblocked == not blocked.

因此,请取消注释代码的按钮单击事件中的第一行.

So uncomment the first line inside the button click event of your code.

演示: http://jsfiddle.net/naveen/D9GCj/1/

请注意,asp:Button将呈现为input type="submit"

这篇关于按钮上的BlockUI jQuery单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆