Question

I'm not sure what I did wrongly the BlockUI isn't working. Hope you guys can help, Thanks.

I am trying to make after clicked the search button, the UI will unavailable from user.

 <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">


    <script src="../JS/jquery-1.9.1.js" type="text/javascript"></script>

    <script src="../JS/jquery.blockUI.js" type="text/javascript"></script>

    <script type="text/javascript">
     $(document).ready(function() {
     $('<%= btnSearch.ClientID %>').click(function() {
         $.blockUI({ message: 'Just a momeqweqwent...'});

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

<asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="Rect" OnClick="btnSearch_Click">
                </asp:Button>
Was it helpful?

Solution

Add hash symbol to btnSearch selector: $('#<%= btnSearch.ClientID %>')

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top