c# - asp.net button works once and then stops working -
i have imagefield works once first time displays messagebox when close messagebox using cancel button , here how
<script type="text/javascript"> $(document).ready(function() { $('#<%= imagebutton1.clientid %>').click(function() { alert('hello'); // works once $.blockui({message: $('#maininsert')}); }); $('#<%= button2.clientid %>').click(function() { $.unblockui(); }); }); </script>
here how definsedh image button
<br /> <asp:imagebutton id="imagebutton1" runat="server" imagealign="right" imageurl="/_layouts/n.png" /> <br /> <br />
here's cancel button code,
<div id="maininsert" style="display: none; cursor: default"> <asp:button id="button2" text="cancel" runat="server" cssclass="rightbutton" /> </div>
you may bubbling through other events. sure stop propogation through click events of parents , children.
<script type="text/javascript"> $(document).ready(function() { $('#<%= imagebutton1.clientid %>').click(function(event) { alert('hello'); // works once $.blockui({message: $('#maininsert')}); event.stoppropagation(); }); $('#<%= button2.clientid %>').click(function(event) { $.unblockui(); event.stoppropagation(); }); }); </script>
i not solve it, seems first shot.
joey
Comments
Post a Comment