Custom Validator and ServerValidateEventArgs
- From: "zeplynne" <motleycrue@xxxxxxxxxxx>
- Date: Tue, 1 Jul 2008 17:02:20 -0400
Having a problem with ServerValidateEventArgs value when a Custom Validator
is fired. The method that is executed is very simple. Evertime it is fired
the value of ServerValidateEventArgs is always blank while debugging (the
textbox does have a value in it). The code is from a web control that is
inside another web control (aspx page that has control on it, and that
control contains the control that doesn't validate). Both controls are
using MultiViews if that matters. If I put this control and its code on a
simple aspx page (one control on an aspx page) it works fine. Any ideas?
Thanks for reading.
protected void ValidateSecurityCode(object sender, ServerValidateEventArgs
e)
{
if (_required)
{
//check to see if it has a value or not
e.IsValid = !string.IsNullOrEmpty(e.Value);
}
else
{
e.IsValid = true;
}
}
<asp:TextBox runat="server" ID="CodeTextBox" ValidationGroup="PaymentValues"
EnableViewState="false"/>
<asp:CustomValidator runat="server" ID="CodeCustomValidator"
OnServerValidate="ValidateSecurityCode"
ControlToValidate="CodeTextBox" meta:resourceKey="CodeTextBoxResource"
ValidateEmptyText="true" CssClass="formValidationErrorInline"
ForeColor="#db4242"
ValidationGroup="PaymentValues" />
.
- Follow-Ups:
- Re: Custom Validator and ServerValidateEventArgs
- From: Peter Bucher [MVP]
- Re: Custom Validator and ServerValidateEventArgs
- From: Tanzim Saqib
- Re: Custom Validator and ServerValidateEventArgs
- Prev by Date: Re: asp.net 2.0 and Ajax
- Next by Date: Re: Custom Validator and ServerValidateEventArgs
- Previous by thread: Re: asp.net 2.0 and Ajax
- Next by thread: Re: Custom Validator and ServerValidateEventArgs
- Index(es):
Relevant Pages
|