Custom Validator and ServerValidateEventArgs

Tech-Archive recommends: Fix windows errors by optimizing your registry



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" />


.



Relevant Pages

  • Custom Validator and ServerValidateEventArgs
    ... Having a problem with ServerValidateEventArgs value when a Custom Validator ... The code is from a web control that is ... simple aspx page it works fine. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Custom Validator and ServerValidateEventArgs
    ... The code is from a web control that is ... using MultiViews if that matters. ... simple aspx page it works fine. ... protected void ValidateSecurityCode(object sender, ServerValidateEventArgs ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • RE: passing variables from .aspx.cs code pages to .aspx pages
    ... snippet, I've got the cause of your problem, for ASP.NET server control, we ... in the aspx page's inline template, but we can adjust those parameters' ... Microsoft Online Support ... |> | protected void Page_Load ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: usercontrols + code-behind
    ... Each .aspx page that uses this ... > control has appropriate directives at the top of the page: ... protected MyControl myCtl; ... I now get an error whenever the .NET Framework compiles each ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: usercontrols + code-behind
    ... Each .aspx page that uses this ... > control has appropriate directives at the top of the page: ... protected MyControl myCtl; ... I now get an error whenever the .NET Framework compiles each ...
    (microsoft.public.dotnet.framework.aspnet)