Hi AnkitPal,
Your code needs to be modified like below you need to raise the alert client side because at server side you are using Response.Redirect which stops the working functionality of client side so thats why your alert is not raising so one thing you can do is write a function at client side which will raise a alert on button click and after that it will go the server side code and the page will get refreshed so refer below code
HTML
<div>
<asp:Button ID="btnsave" Text="Save" OnClick="btnsave_Click" runat="server" />
</div>
<div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('[id*=btnsave]').click(function () {
alert('Dear Student Your Query has been Sent to ECC.');
});
});
</script>
</div>
C#
protected void btnsave_Click(object sender, System.EventArgs e)
{
//connectionstrings
cnn.Open();
//insert command
cmd.ExecuteNonQuery();
Response.Redirect(Request.Url.AbsoluteUri);
}