<script runat="server">
Sub script1(obj As Object, e As EventArgs)
lblMsg1.Text="You pressed the default button"
End Sub
Sub script2(obj As Object, e As EventArgs)
lblMsg2.Text="You did not press the default button"
End Sub
</script>
<!DOCTYPE html>
<html>
<body>
<form runat="server">
<asp:Panel id="panel1" runat="server" BackColor="#8FBC8F" Height="70px" Width="350px" DefaultButton="bt1" >
<asp:TextBox ID="tb1" Columns="50" runat="server"
Text="Press 'Enter' while in this box to 'click' the default button" />
<br>
<asp:Button id="bt1" OnClick="script1" Text="Default" runat="server" />
<asp:label id="lblMsg1" runat="server" />
<br>
<asp:Button id="bt2" OnClick="script2" Text="Not Default" runat="server" />
<asp:label id="lblMsg2" runat="server" />
</asp:Panel>
</form>
</body>
</html>