required field validator

Discussion in 'ASP .Net' started by hansiman, Nov 30, 2004.

  1. hansiman

    hansiman Guest

    I'm having trouble getting the required field validator to work. I can
    still save the row in the datagrid... I can't see what I'm doing
    wrong.

    <asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
    <ItemTemplate>
    <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
    "DataItem.Password") %>' ID="lblPassword"></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
    "DataItem.Password") %>' ID="txtPassword" Width="50">
    </asp:TextBox>
    <asp:RequiredFieldValidator id="rfvPassword" runat="server"
    ErrorMessage="*" ControlToValidate="txtPassword"
    Display="Dynamic"></asp:RequiredFieldValidator>
    </EditItemTemplate>
    </asp:TemplateColumn>
     
    hansiman, Nov 30, 2004
    #1
    1. Advertising

  2. hansiman

    Peter Blum Guest

    Two possible problems.

    1. Client-side validation is not correctly setup.
    On the server, run this command (via cmd.exe):
    aspnet_regiis.exe -c
    from [windows]\microsoft.net\framework\[version]

    2. Server side validation has not been correctly coded.
    You must always check Page.IsValid is true in your post back event handler
    method before saving.

    --- Peter Blum
    www.PeterBlum.com
    Email:
    Creator of "Professional Validation And More" at
    http://www.peterblum.com/vam/home.aspx

    "hansiman" <> wrote in message
    news:...
    > I'm having trouble getting the required field validator to work. I can
    > still save the row in the datagrid... I can't see what I'm doing
    > wrong.
    >
    > <asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
    > <ItemTemplate>
    > <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
    > "DataItem.Password") %>' ID="lblPassword"></asp:Label>
    > </ItemTemplate>
    > <EditItemTemplate>
    > <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
    > "DataItem.Password") %>' ID="txtPassword" Width="50">
    > </asp:TextBox>
    > <asp:RequiredFieldValidator id="rfvPassword" runat="server"
    > ErrorMessage="*" ControlToValidate="txtPassword"
    > Display="Dynamic"></asp:RequiredFieldValidator>
    > </EditItemTemplate>
    > </asp:TemplateColumn>
    >
     
    Peter Blum, Nov 30, 2004
    #2
    1. Advertising

  3. hansiman

    hansiman Guest

    It's strange as the client side validation works fine on another site
    on the same server. The working site runs as in a virtual folder under
    the server's ip. The site not working is set up as an independent
    site! Could this be the problem?

    The folder "aspnet_client" only resides in my wwwroot folder. Could I
    simply xcopy the aspnet_client folder to the new site's root?

    Will running "aspnet_regiis.exe -c
    from [windows]\microsoft.net\framework\[version]" cause changes to
    existing sites?

    Morten

    On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <>
    wrote:

    >Two possible problems.
    >
    >1. Client-side validation is not correctly setup.
    >On the server, run this command (via cmd.exe):
    >aspnet_regiis.exe -c
    >from [windows]\microsoft.net\framework\[version]
    >
    >2. Server side validation has not been correctly coded.
    >You must always check Page.IsValid is true in your post back event handler
    >method before saving.
    >
    >--- Peter Blum
    >www.PeterBlum.com
    >Email:
    >Creator of "Professional Validation And More" at
    >http://www.peterblum.com/vam/home.aspx
    >
    >"hansiman" <> wrote in message
    >news:...
    >> I'm having trouble getting the required field validator to work. I can
    >> still save the row in the datagrid... I can't see what I'm doing
    >> wrong.
    >>
    >> <asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
    >> <ItemTemplate>
    >> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
    >> "DataItem.Password") %>' ID="lblPassword"></asp:Label>
    >> </ItemTemplate>
    >> <EditItemTemplate>
    >> <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
    >> "DataItem.Password") %>' ID="txtPassword" Width="50">
    >> </asp:TextBox>
    >> <asp:RequiredFieldValidator id="rfvPassword" runat="server"
    >> ErrorMessage="*" ControlToValidate="txtPassword"
    >> Display="Dynamic"></asp:RequiredFieldValidator>
    >> </EditItemTemplate>
    >> </asp:TemplateColumn>
    >>

    >
     
    hansiman, Nov 30, 2004
    #3
  4. Hanisman..just run the command on the PC thats not working..
    GDLUCK
    Patrick

    "hansiman" wrote:

    > It's strange as the client side validation works fine on another site
    > on the same server. The working site runs as in a virtual folder under
    > the server's ip. The site not working is set up as an independent
    > site! Could this be the problem?
    >
    > The folder "aspnet_client" only resides in my wwwroot folder. Could I
    > simply xcopy the aspnet_client folder to the new site's root?
    >
    > Will running "aspnet_regiis.exe -c
    > from [windows]\microsoft.net\framework\[version]" cause changes to
    > existing sites?
    >
    > Morten
    >
    > On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <>
    > wrote:
    >
    > >Two possible problems.
    > >
    > >1. Client-side validation is not correctly setup.
    > >On the server, run this command (via cmd.exe):
    > >aspnet_regiis.exe -c
    > >from [windows]\microsoft.net\framework\[version]
    > >
    > >2. Server side validation has not been correctly coded.
    > >You must always check Page.IsValid is true in your post back event handler
    > >method before saving.
    > >
    > >--- Peter Blum
    > >www.PeterBlum.com
    > >Email:
    > >Creator of "Professional Validation And More" at
    > >http://www.peterblum.com/vam/home.aspx
    > >
    > >"hansiman" <> wrote in message
    > >news:...
    > >> I'm having trouble getting the required field validator to work. I can
    > >> still save the row in the datagrid... I can't see what I'm doing
    > >> wrong.
    > >>
    > >> <asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
    > >> <ItemTemplate>
    > >> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
    > >> "DataItem.Password") %>' ID="lblPassword"></asp:Label>
    > >> </ItemTemplate>
    > >> <EditItemTemplate>
    > >> <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
    > >> "DataItem.Password") %>' ID="txtPassword" Width="50">
    > >> </asp:TextBox>
    > >> <asp:RequiredFieldValidator id="rfvPassword" runat="server"
    > >> ErrorMessage="*" ControlToValidate="txtPassword"
    > >> Display="Dynamic"></asp:RequiredFieldValidator>
    > >> </EditItemTemplate>
    > >> </asp:TemplateColumn>
    > >>

    > >

    >
    >
     
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 30, 2004
    #4
  5. hansiman

    hansiman Guest

    running aspnet_regiis.exe -c from
    C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
    made the client side validation work.

    Must I run the tool upon every new site that is created on the server?

    On Tue, 30 Nov 2004 15:17:05 -0800, "Patrick.O.Ige"
    <> wrote:

    >Hanisman..just run the command on the PC thats not working..
    >GDLUCK
    >Patrick
    >
    >"hansiman" wrote:
    >
    >> It's strange as the client side validation works fine on another site
    >> on the same server. The working site runs as in a virtual folder under
    >> the server's ip. The site not working is set up as an independent
    >> site! Could this be the problem?
    >>
    >> The folder "aspnet_client" only resides in my wwwroot folder. Could I
    >> simply xcopy the aspnet_client folder to the new site's root?
    >>
    >> Will running "aspnet_regiis.exe -c
    >> from [windows]\microsoft.net\framework\[version]" cause changes to
    >> existing sites?
    >>
    >> Morten
    >>
    >> On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <>
    >> wrote:
    >>
    >> >Two possible problems.
    >> >
    >> >1. Client-side validation is not correctly setup.
    >> >On the server, run this command (via cmd.exe):
    >> >aspnet_regiis.exe -c
    >> >from [windows]\microsoft.net\framework\[version]
    >> >
    >> >2. Server side validation has not been correctly coded.
    >> >You must always check Page.IsValid is true in your post back event handler
    >> >method before saving.
    >> >
    >> >--- Peter Blum
    >> >www.PeterBlum.com
    >> >Email:
    >> >Creator of "Professional Validation And More" at
    >> >http://www.peterblum.com/vam/home.aspx
    >> >
    >> >"hansiman" <> wrote in message
    >> >news:...
    >> >> I'm having trouble getting the required field validator to work. I can
    >> >> still save the row in the datagrid... I can't see what I'm doing
    >> >> wrong.
    >> >>
    >> >> <asp:TemplateColumn SortExpression="c.Password" HeaderText="Password">
    >> >> <ItemTemplate>
    >> >> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
    >> >> "DataItem.Password") %>' ID="lblPassword"></asp:Label>
    >> >> </ItemTemplate>
    >> >> <EditItemTemplate>
    >> >> <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
    >> >> "DataItem.Password") %>' ID="txtPassword" Width="50">
    >> >> </asp:TextBox>
    >> >> <asp:RequiredFieldValidator id="rfvPassword" runat="server"
    >> >> ErrorMessage="*" ControlToValidate="txtPassword"
    >> >> Display="Dynamic"></asp:RequiredFieldValidator>
    >> >> </EditItemTemplate>
    >> >> </asp:TemplateColumn>
    >> >>
    >> >

    >>
    >>
     
    hansiman, Nov 30, 2004
    #5
  6. hansiman

    Peter Blum Guest

    Its a reasonable action to take. Its required on each new "domain" you
    define.

    --- Peter Blum
    www.PeterBlum.com
    Email:
    Creator of "Professional Validation And More" at
    http://www.peterblum.com/vam/home.aspx

    "hansiman" <> wrote in message
    news:...
    > running aspnet_regiis.exe -c from
    > C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
    > made the client side validation work.
    >
    > Must I run the tool upon every new site that is created on the server?
    >
    > On Tue, 30 Nov 2004 15:17:05 -0800, "Patrick.O.Ige"
    > <> wrote:
    >
    >>Hanisman..just run the command on the PC thats not working..
    >>GDLUCK
    >>Patrick
    >>
    >>"hansiman" wrote:
    >>
    >>> It's strange as the client side validation works fine on another site
    >>> on the same server. The working site runs as in a virtual folder under
    >>> the server's ip. The site not working is set up as an independent
    >>> site! Could this be the problem?
    >>>
    >>> The folder "aspnet_client" only resides in my wwwroot folder. Could I
    >>> simply xcopy the aspnet_client folder to the new site's root?
    >>>
    >>> Will running "aspnet_regiis.exe -c
    >>> from [windows]\microsoft.net\framework\[version]" cause changes to
    >>> existing sites?
    >>>
    >>> Morten
    >>>
    >>> On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <>
    >>> wrote:
    >>>
    >>> >Two possible problems.
    >>> >
    >>> >1. Client-side validation is not correctly setup.
    >>> >On the server, run this command (via cmd.exe):
    >>> >aspnet_regiis.exe -c
    >>> >from [windows]\microsoft.net\framework\[version]
    >>> >
    >>> >2. Server side validation has not been correctly coded.
    >>> >You must always check Page.IsValid is true in your post back event
    >>> >handler
    >>> >method before saving.
    >>> >
    >>> >--- Peter Blum
    >>> >www.PeterBlum.com
    >>> >Email:
    >>> >Creator of "Professional Validation And More" at
    >>> >http://www.peterblum.com/vam/home.aspx
    >>> >
    >>> >"hansiman" <> wrote in message
    >>> >news:...
    >>> >> I'm having trouble getting the required field validator to work. I
    >>> >> can
    >>> >> still save the row in the datagrid... I can't see what I'm doing
    >>> >> wrong.
    >>> >>
    >>> >> <asp:TemplateColumn SortExpression="c.Password"
    >>> >> HeaderText="Password">
    >>> >> <ItemTemplate>
    >>> >> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
    >>> >> "DataItem.Password") %>' ID="lblPassword"></asp:Label>
    >>> >> </ItemTemplate>
    >>> >> <EditItemTemplate>
    >>> >> <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
    >>> >> "DataItem.Password") %>' ID="txtPassword" Width="50">
    >>> >> </asp:TextBox>
    >>> >> <asp:RequiredFieldValidator id="rfvPassword" runat="server"
    >>> >> ErrorMessage="*" ControlToValidate="txtPassword"
    >>> >> Display="Dynamic"></asp:RequiredFieldValidator>
    >>> >> </EditItemTemplate>
    >>> >> </asp:TemplateColumn>
    >>> >>
    >>> >
    >>>
    >>>

    >
     
    Peter Blum, Dec 1, 2004
    #6
  7. hansiman

    hansiman Guest

    thanks for the insight

    On Wed, 1 Dec 2004 13:15:44 -0500, "Peter Blum" <>
    wrote:

    >Its a reasonable action to take. Its required on each new "domain" you
    >define.
    >
    >--- Peter Blum
    >www.PeterBlum.com
    >Email:
    >Creator of "Professional Validation And More" at
    >http://www.peterblum.com/vam/home.aspx
    >
    >"hansiman" <> wrote in message
    >news:...
    >> running aspnet_regiis.exe -c from
    >> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\
    >> made the client side validation work.
    >>
    >> Must I run the tool upon every new site that is created on the server?
    >>
    >> On Tue, 30 Nov 2004 15:17:05 -0800, "Patrick.O.Ige"
    >> <> wrote:
    >>
    >>>Hanisman..just run the command on the PC thats not working..
    >>>GDLUCK
    >>>Patrick
    >>>
    >>>"hansiman" wrote:
    >>>
    >>>> It's strange as the client side validation works fine on another site
    >>>> on the same server. The working site runs as in a virtual folder under
    >>>> the server's ip. The site not working is set up as an independent
    >>>> site! Could this be the problem?
    >>>>
    >>>> The folder "aspnet_client" only resides in my wwwroot folder. Could I
    >>>> simply xcopy the aspnet_client folder to the new site's root?
    >>>>
    >>>> Will running "aspnet_regiis.exe -c
    >>>> from [windows]\microsoft.net\framework\[version]" cause changes to
    >>>> existing sites?
    >>>>
    >>>> Morten
    >>>>
    >>>> On Tue, 30 Nov 2004 12:36:57 -0500, "Peter Blum" <>
    >>>> wrote:
    >>>>
    >>>> >Two possible problems.
    >>>> >
    >>>> >1. Client-side validation is not correctly setup.
    >>>> >On the server, run this command (via cmd.exe):
    >>>> >aspnet_regiis.exe -c
    >>>> >from [windows]\microsoft.net\framework\[version]
    >>>> >
    >>>> >2. Server side validation has not been correctly coded.
    >>>> >You must always check Page.IsValid is true in your post back event
    >>>> >handler
    >>>> >method before saving.
    >>>> >
    >>>> >--- Peter Blum
    >>>> >www.PeterBlum.com
    >>>> >Email:
    >>>> >Creator of "Professional Validation And More" at
    >>>> >http://www.peterblum.com/vam/home.aspx
    >>>> >
    >>>> >"hansiman" <> wrote in message
    >>>> >news:...
    >>>> >> I'm having trouble getting the required field validator to work. I
    >>>> >> can
    >>>> >> still save the row in the datagrid... I can't see what I'm doing
    >>>> >> wrong.
    >>>> >>
    >>>> >> <asp:TemplateColumn SortExpression="c.Password"
    >>>> >> HeaderText="Password">
    >>>> >> <ItemTemplate>
    >>>> >> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
    >>>> >> "DataItem.Password") %>' ID="lblPassword"></asp:Label>
    >>>> >> </ItemTemplate>
    >>>> >> <EditItemTemplate>
    >>>> >> <asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
    >>>> >> "DataItem.Password") %>' ID="txtPassword" Width="50">
    >>>> >> </asp:TextBox>
    >>>> >> <asp:RequiredFieldValidator id="rfvPassword" runat="server"
    >>>> >> ErrorMessage="*" ControlToValidate="txtPassword"
    >>>> >> Display="Dynamic"></asp:RequiredFieldValidator>
    >>>> >> </EditItemTemplate>
    >>>> >> </asp:TemplateColumn>
    >>>> >>
    >>>> >
    >>>>
    >>>>

    >>

    >
     
    hansiman, Dec 4, 2004
    #7
    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. Jinsong Liu

    Required Field Validator Client side popup

    Jinsong Liu, Aug 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    5,573
    Guenther Liebowitz
    Aug 14, 2003
  2. Do
    Replies:
    3
    Views:
    4,456
    Mike Moore [MSFT]
    Oct 23, 2003
  3. Jim Heavey

    Required Field Validator

    Jim Heavey, Nov 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    341
    Jim Heavey
    Nov 14, 2003
  4. Mr. x
    Replies:
    0
    Views:
    346
    Mr. x
    Nov 30, 2003
  5. jr
    Replies:
    3
    Views:
    491
Loading...

Share This Page