Hi ramco1917,
Please refer below updated code.
HTML
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" media="screen" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><b>Confirmation</b></h5>
<button type="button" class="bootbox-close-button close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="bootbox-body">
<div class="bootbox-form">
<!-- Dynamic content can be placed here if needed -->
<asp:Label ID="ltrlDelHead" Text="Are You Sure, You want to Delete This?" runat="server"></asp:Label>
</div>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="lnkCancel" CssClass="btn bg-danger" runat="server"
OnClick="lnkRecordDelete_Click" CommandArgument="Cancel">Cancel</asp:LinkButton>
<asp:LinkButton ID="lnkRecordDelete" CssClass="btn bg-danger" runat="server"
OnClick="lnkRecordDelete_Click" CommandArgument="Delete">Delete</asp:LinkButton>
</div>
</div>
</div>
Code
C#
protected void lnkRecordDelete_Click(object sender, EventArgs e)
{
string commandArgument = (sender as LinkButton).CommandArgument.ToLower();
if(commandArgument == "cancel")
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Cancel button clicked.');", true);
}
else if (commandArgument == "delete")
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Delete button clicked.');", true);
}
}
VB.Net
Protected Sub lnkRecordDelete_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim commandArgument As String = TryCast(sender, LinkButton).CommandArgument.ToLower()
If commandArgument = "cancel" Then
ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "alert", "alert('Cancel button clicked.');", True)
ElseIf commandArgument = "delete" Then
ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "alert", "alert('Delete button clicked.');", True)
End If
End Sub
Screenshot