Re: RequiredFieldValidator question

Discussion in 'ASP .Net' started by Curt_C [MVP], Apr 14, 2004.

  1. Curt_C [MVP]

    Curt_C [MVP] Guest

    IIRC, serverside controls set to visible=false aren't even rendered to the
    client

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "Bill Mild" <> wrote in message
    news:...
    > I have an asp:Textbox with Text="" and Visible=False. A

    RequiredFieldValidator is assigned to validate this textbox. When the
    webform is submitted at runtime, client-side validation does not fire, but
    server-side validation does fire. I would expect client-side and
    server-side validation to perform identically. I woudl expect a
    RequiredFieldValidator not to fire when the control it validates is set to
    Visible=False. However, my expectation does not meet the empirical
    evidence. Is this outcome a bug, or by design? Here is some code to
    duplicate.
    >
    > <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"

    AutoEventWireup="false" Inherits="SmithsDetectionSupplies.WebForm1"
    %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    ><HTML><HEAD><title>WebForm1</title><meta name="GENERATOR"

    Content="Microsoft Visual Studio .NET 7.1"><meta name="CODE_LANGUAGE"
    Content="C#"><meta name="vs_defaultClientScript" content="JavaScript"><meta
    name="vs_targetSchema"
    content="http://schemas.microsoft.com/intellisense/ie5"></HEAD><body
    MS_POSITIONING="GridLayout"><form id="Form1" method="post"
    runat="server"><asp:Label id="Other" runat="server"
    Visible="False">Other:</asp:Label><asp:TextBox id="TypeOfOrganizationOther"
    runat="server" Visible="False"></asp:TextBox><asp:RequiredFieldValidator
    id="TypeOfOrganizationOtherRequired" runat="server"
    ControlToValidate="TypeOfOrganizationOther"
    > Display="Dynamic" ErrorMessage="2Your type of organization is required."

    InitialValue=""></asp:RequiredFieldValidator><asp:Button id="Register"
    runat="server" Text="Register"></asp:Button></form></body></HTML>
     
    Curt_C [MVP], Apr 14, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pc
    Replies:
    2
    Views:
    389
    Peter Chang
    Jul 28, 2003
  2. Vic
    Replies:
    2
    Views:
    345
  3. Steven Cheng[MSFT]

    RE: RequiredFieldValidator question

    Steven Cheng[MSFT], Apr 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,818
    Peter Blum
    Apr 15, 2004
  4. James Radke

    RequiredFieldValidator question..

    James Radke, Oct 14, 2003, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    179
    Yan-Hong Huang[MSFT]
    Oct 29, 2003
  5. Randel Bjorkquist

    RequiredFieldValidator Question

    Randel Bjorkquist, Mar 29, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    156
    Randel Bjorkquist
    Mar 29, 2005
Loading...

Share This Page