Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

65 lines
1009 B
Plaintext

<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>
<script runat="server">
void ButtonClick(Object sender, EventArgs e)
{
if (Page.IsValid)
{
Label1.Text="Page is valid.";
}
else
{
Label1.Text="Page is not valid!!";
}
}
</script>
</head>
<body>
<form runat="server">
<h3>CustomValidator Example</h3>
Enter something
<br>
<asp:TextBox id="TextBox1"
runat="server"/>
<br>
<asp:CustomValidator id="Custom1"
ControlToValidate="TextBox1"
ClientValidationFunction="OhBabyValidateMe"
Text="Dude, watch what you're entering!"
runat="server"/>
<br><br>
<asp:Label id="Label1"
runat="server"/>
<br><br>
<asp:Button id="Button1"
Text="Submit"
OnClick="ButtonClick"
runat="server"/>
</form>
</body>
</html>