I am pasting the sample code for easy understanding.
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
cls.Attributes.Add("onclick","return confirm('Are you Sure you want to delete?');")
End Sub
Sub clsthread(Source As Object, E As EventArgs)
Dim scripts as String ="<script>alert('The record is deleted')"+"</"+"script>"
RegisterClientScriptBlock("alert1",scripts)
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="cls" onclick="clsthread" runat="server" Text="Close Thread"></asp:Button>
</form>
</body>
</html>