Question: Hi I've an input button like 

```
<input id="btnDelete" type="button" value="Delete" name="btnDelete" runat="server" onclick="return confirm('Are you sure you wish to delete these records?');" />

and my serverside code is

Private Sub btnDelete_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.ServerClick

' my code here

End Sub

```

but when I click on delete button I'm getting confirm msg box, but after that it is not going to server side event.

Anything wrong in this?

Thank you

Answer: 
USE [OnClientClick](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.onclientclick.aspx#Y570) for your client side javascript validation 

```
   <asp:BUTTON id="btnDelete"  name="btnDelete" value="Delete" onclick="btnDelete_ServerClick"                    
    OnClientClick="return confirm('Are you sure you wish to delete these records?');"/>

```

IF you are using HTML control then this may be helpful: [How to call code behind server method from a client side javascript function?](https://stackoverflow.com/questions/5828803/how-to-call-code-behind-server-method-from-a-client-side-javascript-function)

CHECK THIS OUT ALSO [\_doPostBack()](http://wiki.asp.net/404.aspx?aspxerrorpath=/themes/fan/pages/page.aspx/1082/dopostback-function/)
Maybe because its not a type=submit button?

```
<form name="frmPerson" action="/dome.asp">
   some form fields here
   .
   .
   <input id="btnDelete" type="submit" name="btnDelete" value="Delete" />
</form>

```