validator control not triggering in formview

Discussion in 'ASP .Net' started by =?Utf-8?B?RGFiYmxlcg==?=, Apr 9, 2006.

  1. I have a FormView with lots of field that have validators attached but none
    of them are working. Most are RequiredFieldValidtors, some are Regex etc.

    here's some of my code:
    <asp:FormView ID="fvRegDetail" runat="server" DefaultMode="Edit"
    DataKeyNames="RegistrantId" DataSourceID="odsRegistrant"
    CssClass="waFormView" >
    ......
    <EditItemTemplate>
    <asp:TextBox ID="tbWArrival" Text='<%# Bind("WArrival")
    %>' ReadOnly="false" runat="server" CssClass="waTextBox" MaxLength="6"
    Width="64px"></asp:TextBox>
    <asp:RequiredFieldValidator
    ID="RequiredFieldValidator11" runat="server"
    ErrorMessage="Arrival time is required"
    ValidationGroup="regForm"
    SetFocusOnError="true"
    ControlToValidate="tbWArrival"><img src="~/images/bangs.gif" title="required"
    /></asp:RequiredFieldValidator>
    ....
    <asp:ValidationSummary ID="ValidationSummary1" runat="server"
    ValidationGroup="regForm" ShowMessageBox="true" ShowSummary="false"
    HeaderText="Please review the following errors:"/>

    <asp:Button ID="UpdateButton" runat="server" CausesValidation="True"
    CommandName="Update" Text="Update" ValidationGroup="RegForm">
    </asp:Button>

    </EditItemTemplate>
    </asp:FormView>

    Any ideas on why this isn't working would be appreciated
     
    =?Utf-8?B?RGFiYmxlcg==?=, Apr 9, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?RGFiYmxlcg==?=

    Guest

    is your formview within another control that is hidden when the page is
    loaded?
    i had a formview within a Panel. The panel was visible='False' and only
    shown in the Page_PreRender if it was required. Because of this none of
    the validation controls ever ran. It seems that server side validation
    is only run on controls that are visible when the validation is run,
    which is after Page_Load and before Page_PreRender.
     
    , May 3, 2006
    #2
    1. Advertising

  3. thanks, I solved this a long time ago, but can't remember what the problem
    was, there have been so many since ;)

    "" wrote:

    > is your formview within another control that is hidden when the page is
    > loaded?
    > i had a formview within a Panel. The panel was visible='False' and only
    > shown in the Page_PreRender if it was required. Because of this none of
    > the validation controls ever ran. It seems that server side validation
    > is only run on controls that are visible when the validation is run,
    > which is after Page_Load and before Page_PreRender.
    >
    >
     
    =?Utf-8?B?RGFiYmxlcg==?=, May 3, 2006
    #3
    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. Eric B
    Replies:
    1
    Views:
    1,936
    Eric B
    Sep 3, 2003
  2. =?Utf-8?B?SmltIFJleW5vbGRz?=

    triggering user control events

    =?Utf-8?B?SmltIFJleW5vbGRz?=, Jan 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    435
    =?Utf-8?B?SmltIFJleW5vbGRz?=
    Jan 17, 2005
  3. Replies:
    1
    Views:
    2,081
    Daniel TIZON
    Dec 17, 2005
  4. BlackHelicopter
    Replies:
    1
    Views:
    594
    eliascm
    Jun 3, 2010
  5. George Leithead
    Replies:
    2
    Views:
    203
    George Leithead
    Jun 23, 2006
Loading...

Share This Page