<%@ Page Language="VB" %>
<script runat="server">
sub Submit(Sender as Object, e as EventArgs)
if Page.IsValid then
lblMessage.Text = "You passed validation!"
end if
end sub
</script>
<html>
<body>
<form runat="server">
<asp:Label id="lblMessage" runat="server" />
Enter your name:
<asp:TextBox id="tbFName" runat="server" /><br>
<asp:RequiredFieldValidator runat="server" ControlToValidate="tbFName" ErrorMessage="First name required"/>
<asp:Button id="tbSubmit" runat="server" Text="Submit" OnClick="Submit" />
</form>
</body>
</html>