I am using “BLOCKUI” jquery confirmation dialog box plugin, Its working perfectly except its not reseting the button it gets poped up on,
Maybe its a logical mistake :/, here’s the code,
Script
<script type="text/javascript" src="/_layouts/1033/jquery.js"></script>
<script type="text/javascript" src="JS.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("input[id$='btDelete']").click(function() {
$.blockUI({ message: $('#question'), css: { width: '620px' } });
});
$("input[id$='yes']").click(function() {
$.blockUI({ message: "" });
});
$("input[id$='no']").click(function() {
$.unblockUI();
return false;
});
});
</script>
Div Tag
<asp:Content ID="Content4" ContentPlaceHolderID="cphSubmit" runat="server">
<div id="question" style="display:none; background-color:Menu; cursor: default">
<div align="center">
<br /><asp:Label ID="Label1" runat="server" Text="Deleting this eDecision will remove all site content and uploaded documents.<br />Are you sure you wish to continue?" CssClass="headertext"></asp:Label><br /><br /><br /><br /><br />
<asp:Button ID="yes" Width="200px" Height="25px" CssClass="gradientbutton" OnClick="btDelete_Click" Runat="server" Text="Yes"></asp:Button>
<asp:Button ID="no" Width="200px" Height="25px" CssClass="gradientbutton" Runat="server" Text="No"></asp:Button><br /><br /><br />
</div>
</div>
Button
<td>
<asp:Button ID="btDelete" runat="server" CssClass="gradientbutton" OnClick="btDelete_Click"
OnClientClick="this.disabled=true;" Text="Delete" Width="200px" />
</td>
If I make changes to the button as
<asp:Button ID="btDelete" runat="server" CssClass="gradientbutton" Text="Delete" Width="200px" />
The dialog box appears and then disappears :S
and IF button is like below, dialog appears but then even if i press “No” delete button stays disabled,
<asp:Button ID="btDelete" runat="server" CssClass="gradientbutton" OnClick="btDelete_Click"
OnClientClick="this.disabled=true;" Text="Delete" Width="200px" />
Cheers
Try this
And your button without the OnClientClick. You already have a client-click event above. The return false will stop the event bubbling and prevent the submit of the asp.net button.