473,382 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

required field validator

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>

Nov 18 '05 #1
6 2243
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail.com> wrote in message
news:8f********************************@4ax.com...
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>

Nov 18 '05 #2
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" <PL****@Blum.info>
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail.com> wrote in message
news:8f********************************@4ax.com.. .
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>


Nov 18 '05 #3
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" <PL****@Blum.info>
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail.com> wrote in message
news:8f********************************@4ax.com.. .
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>


Nov 18 '05 #4
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"
<Pa*********@discussions.microsoft.com> 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" <PL****@Blum.info>
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: PL****@PeterBlum.com
>Creator of "Professional Validation And More" at
>http://www.peterblum.com/vam/home.aspx
>
>"hansiman" <ha***@hotmail.com> wrote in message
>news:8f********************************@4ax.com.. .
>> 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>
>>
>



Nov 18 '05 #5
Its a reasonable action to take. Its required on each new "domain" you
define.

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

"hansiman" <ha***@hotmail.com> wrote in message
news:vb********************************@4ax.com...
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"
<Pa*********@discussions.microsoft.com> 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" <PL****@Blum.info>
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: PL****@PeterBlum.com
>Creator of "Professional Validation And More" at
>http://www.peterblum.com/vam/home.aspx
>
>"hansiman" <ha***@hotmail.com> wrote in message
>news:8f********************************@4ax.com.. .
>> 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>
>>
>

Nov 18 '05 #6
thanks for the insight

On Wed, 1 Dec 2004 13:15:44 -0500, "Peter Blum" <PL****@Blum.info>
wrote:
Its a reasonable action to take. Its required on each new "domain" you
define.

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

"hansiman" <ha***@hotmail.com> wrote in message
news:vb********************************@4ax.com.. .
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"
<Pa*********@discussions.microsoft.com> 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" <PL****@Blum.info>
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: PL****@PeterBlum.com
>Creator of "Professional Validation And More" at
>http://www.peterblum.com/vam/home.aspx
>
>"hansiman" <ha***@hotmail.com> wrote in message
>news:8f********************************@4ax.com.. .
>> 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>
>>
>


Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin | last post by:
Dear Group It says in MSDN that a field can be associated with more than one validators but can one validator be associated with more than one field? Or do I need a validator for each field? How...
2
by: z. f. | last post by:
Hi, i have a field with required field validator. on the client side it's working. when i submit without the required field the page gets back because of not valid, but the message from the...
1
by: Brian Shannon | last post by:
I built a composit control consisting of a calandar control and a text box and an image of a calandar. Depending on what page I place this control the Date field needs to be required. If the...
1
by: Sam Collett | last post by:
Is there a way of having a required field validator check to see if at least one of a set of controls has information in it? I'm sure this can somehow be done using a custom validator, but would...
2
by: pmud | last post by:
Hi, I have an ASP.Net web page . The page was working fine until I added a required field field validator. My page has a link button which takes the user to another page, a submit button which...
3
by: Skeptical | last post by:
Hello, I have a form and two buttons on it. Button1 submits the data to a database and RequiredFieldValidator is used to make sure all the required fields are filled up, the second button has a...
2
by: David Hearn | last post by:
I have some required field validators on a form and would like to know if there is a way to set focus back to the field that is required if the validator is triggered. The problem is that the...
3
by: Kivak Wolf | last post by:
Hi, Could someone give me a quick review of how to use the required field Validator? I'm completely at a loss, and MSDN does not help one bit. =/ Basically all I want done is to make sure that...
3
by: Mike Collins | last post by:
Is it possible to use a required field validator and have it make a user answer a comment field based on a drop down value picked? For instance, if the user selects "It was terrible", make them...
0
by: nimeshdotnet | last post by:
Hi All, I have a textbox whose readonly property is set to true. This textbox is also guarded by a required field validator. What i m doing that I have a calendar control whose on date selection i...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.