K
K Viltersten
I've followed the instructions for setting up a validation
of my forms (link below). For some reason, the
evaluation doesn't take place. My husband said he won't
help me on this one because it's easy. It's doesn't feel
that easy, so i'm not sure if he teases or means it...
http://msdn.microsoft.com/en-us/library/f5db6z8k.aspx
In fact, i don't seem to even enter the evaluation method
when i try to run the site in the debugger. However,
altering the name of it creates an error.
<form id="form1" runat="server">
<div>
<asp:Label ID="InfoOnstatus" runat="server">
No info yet! </asp:Label><br />
<asp:TextBox ID="TextBox1" runat="server" /><br />
<asp:CustomValidator ID="CustomValidator1" runat="server"
ValidateEmptyText="true"
ControlToValidate="TextBox1" OnServerValidate="TextValidate"
ErrorMessage="Invalid!"></asp:CustomValidator>
</div>
</form>
....
protected void TextValidate(
object sender, ServerValidateEventArgs e) {
InfoOnstatus.Text = "validated field";
if (e.Value == "qw")
e.IsValid = true;
else
e.IsValid = false;
}
....
What's wrong here? How can i troubleshoot it?
of my forms (link below). For some reason, the
evaluation doesn't take place. My husband said he won't
help me on this one because it's easy. It's doesn't feel
that easy, so i'm not sure if he teases or means it...
http://msdn.microsoft.com/en-us/library/f5db6z8k.aspx
In fact, i don't seem to even enter the evaluation method
when i try to run the site in the debugger. However,
altering the name of it creates an error.
<form id="form1" runat="server">
<div>
<asp:Label ID="InfoOnstatus" runat="server">
No info yet! </asp:Label><br />
<asp:TextBox ID="TextBox1" runat="server" /><br />
<asp:CustomValidator ID="CustomValidator1" runat="server"
ValidateEmptyText="true"
ControlToValidate="TextBox1" OnServerValidate="TextValidate"
ErrorMessage="Invalid!"></asp:CustomValidator>
</div>
</form>
....
protected void TextValidate(
object sender, ServerValidateEventArgs e) {
InfoOnstatus.Text = "validated field";
if (e.Value == "qw")
e.IsValid = true;
else
e.IsValid = false;
}
....
What's wrong here? How can i troubleshoot it?