ASP.Net Button will not work inside dialog hence you will have to do the following trick.
1. Place the button outside dialog and hide it using style="display:none"
2. Now on the OK Button click of Dialog call the ASP.Net Button Click event.
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/redmond/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function () {
$("#dialog").dialog({
buttons: {
Ok: function () {
$("[id*=Button1]").click();
}
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="dialog" style="display:none">
This is a Sample Dialog
</div>
<asp:Button ID="Button1" runat="server" Text="Button" style = "display:none" OnClick = "Button1_Click" />
</form>
</body>
</html>
protected void Button1_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(Page.GetType(), "key", "alert('Button Clicked')", true);
}