473,671 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:TemplateCo lumn SortExpression= "c.Password " HeaderText="Pas sword">
<ItemTemplate >
<asp:Label runat="server" Text='<%# DataBinder.Eval (Container,
"DataItem.Passw ord") %>' ID="lblPassword "></asp:Label>
</ItemTemplate>
<EditItemTempla te>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval (Container,
"DataItem.Passw ord") %>' ID="txtPassword " Width="50">
</asp:TextBox>
<asp:RequiredFi eldValidator id="rfvPassword " runat="server"
ErrorMessage="* " ControlToValida te="txtPassword "
Display="Dynami c"></asp:RequiredFie ldValidator>
</EditItemTemplat e>
</asp:TemplateCol umn>

Nov 18 '05 #1
6 2274
Two possible problems.

1. Client-side validation is not correctly setup.
On the server, run this command (via cmd.exe):
aspnet_regiis.e xe -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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail. com> wrote in message
news:8f******** *************** *********@4ax.c om...
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:TemplateCo lumn SortExpression= "c.Password " HeaderText="Pas sword">
<ItemTemplate >
<asp:Label runat="server" Text='<%# DataBinder.Eval (Container,
"DataItem.Passw ord") %>' ID="lblPassword "></asp:Label>
</ItemTemplate>
<EditItemTempla te>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval (Container,
"DataItem.Passw ord") %>' ID="txtPassword " Width="50">
</asp:TextBox>
<asp:RequiredFi eldValidator id="rfvPassword " runat="server"
ErrorMessage="* " ControlToValida te="txtPassword "
Display="Dynami c"></asp:RequiredFie ldValidator>
</EditItemTemplat e>
</asp:TemplateCol umn>

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_cli ent" 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.in fo>
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****@PeterBlu m.com
Creator of "Profession al 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:TemplateCo lumn SortExpression= "c.Password " HeaderText="Pas sword">
<ItemTemplate >
<asp:Label runat="server" Text='<%# DataBinder.Eval (Container,
"DataItem.Passw ord") %>' ID="lblPassword "></asp:Label>
</ItemTemplate>
<EditItemTempla te>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval (Container,
"DataItem.Passw ord") %>' ID="txtPassword " Width="50">
</asp:TextBox>
<asp:RequiredFi eldValidator id="rfvPassword " runat="server"
ErrorMessage="* " ControlToValida te="txtPassword "
Display="Dynami c"></asp:RequiredFie ldValidator>
</EditItemTemplat e>
</asp:TemplateCol umn>


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_cli ent" 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.in fo>
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****@PeterBlu m.com
Creator of "Profession al 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:TemplateCo lumn SortExpression= "c.Password " HeaderText="Pas sword">
<ItemTemplate >
<asp:Label runat="server" Text='<%# DataBinder.Eval (Container,
"DataItem.Passw ord") %>' ID="lblPassword "></asp:Label>
</ItemTemplate>
<EditItemTempla te>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval (Container,
"DataItem.Passw ord") %>' ID="txtPassword " Width="50">
</asp:TextBox>
<asp:RequiredFi eldValidator id="rfvPassword " runat="server"
ErrorMessage="* " ControlToValida te="txtPassword "
Display="Dynami c"></asp:RequiredFie ldValidator>
</EditItemTemplat e>
</asp:TemplateCol umn>


Nov 18 '05 #4
running aspnet_regiis.e xe -c from
C:\WINDOWS\Micr osoft.NET\Frame work\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*********@di scussions.micro soft.com> wrote:
Hanisman..ju st 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_cli ent" 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.in fo>
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****@PeterBlu m.com
>Creator of "Profession al 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:TemplateCo lumn SortExpression= "c.Password " HeaderText="Pas sword">
>> <ItemTemplate >
>> <asp:Label runat="server" Text='<%# DataBinder.Eval (Container,
>> "DataItem.Passw ord") %>' ID="lblPassword "></asp:Label>
>> </ItemTemplate>
>> <EditItemTempla te>
>> <asp:TextBox runat="server" Text='<%# DataBinder.Eval (Container,
>> "DataItem.Passw ord") %>' ID="txtPassword " Width="50">
>> </asp:TextBox>
>> <asp:RequiredFi eldValidator id="rfvPassword " runat="server"
>> ErrorMessage="* " ControlToValida te="txtPassword "
>> Display="Dynami c"></asp:RequiredFie ldValidator>
>> </EditItemTemplat e>
>> </asp:TemplateCol umn>
>>
>



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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"hansiman" <ha***@hotmail. com> wrote in message
news:vb******** *************** *********@4ax.c om...
running aspnet_regiis.e xe -c from
C:\WINDOWS\Micr osoft.NET\Frame work\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*********@di scussions.micro soft.com> wrote:
Hanisman..jus t 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_cli ent" 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.in fo>
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****@PeterBlu m.com
>Creator of "Profession al 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:TemplateCo lumn SortExpression= "c.Password "
>> HeaderText="Pas sword">
>> <ItemTemplate >
>> <asp:Label runat="server" Text='<%# DataBinder.Eval (Container,
>> "DataItem.Passw ord") %>' ID="lblPassword "></asp:Label>
>> </ItemTemplate>
>> <EditItemTempla te>
>> <asp:TextBox runat="server" Text='<%# DataBinder.Eval (Container,
>> "DataItem.Passw ord") %>' ID="txtPassword " Width="50">
>> </asp:TextBox>
>> <asp:RequiredFi eldValidator id="rfvPassword " runat="server"
>> ErrorMessage="* " ControlToValida te="txtPassword "
>> Display="Dynami c"></asp:RequiredFie ldValidator>
>> </EditItemTemplat e>
>> </asp:TemplateCol umn>
>>
>

Nov 18 '05 #6
thanks for the insight

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

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al 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.e xe -c from
C:\WINDOWS\Micr osoft.NET\Frame work\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*********@di scussions.micro soft.com> wrote:
Hanisman..ju st 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_cli ent" 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.in fo>
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****@PeterBlu m.com
>Creator of "Profession al 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:TemplateCo lumn SortExpression= "c.Password "
>> HeaderText="Pas sword">
>> <ItemTemplate >
>> <asp:Label runat="server" Text='<%# DataBinder.Eval (Container,
>> "DataItem.Passw ord") %>' ID="lblPassword "></asp:Label>
>> </ItemTemplate>
>> <EditItemTempla te>
>> <asp:TextBox runat="server" Text='<%# DataBinder.Eval (Container,
>> "DataItem.Passw ord") %>' ID="txtPassword " Width="50">
>> </asp:TextBox>
>> <asp:RequiredFi eldValidator id="rfvPassword " runat="server"
>> ErrorMessage="* " ControlToValida te="txtPassword "
>> Display="Dynami c"></asp:RequiredFie ldValidator>
>> </EditItemTemplat e>
>> </asp:TemplateCol umn>
>>
>


Nov 19 '05 #7

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

Similar topics

2
683
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 does it work? Using Handlers? Thanks for your efforts! Martin
2
2454
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 validator is not shown! what is wrong? TIA, z.
1
410
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 date field needs to be required can I somehow use the required date validator on the main page where the conrol is placed. The date text box is accessible through a property. Or do I need to use a custom validator? Thanks for any input
1
2996
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 like a validator that worked like as a custom tag: <MyValidator:MultipleRequiredFieldValidator ControlsToValidate="TextBox1,TextBox2,TextBox3" ErrorMessage="You did not fill in one of the required fields: TextBox1,TextBox2,TextBox3"...
2
2347
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 takes the values of the text boxes & puts them into an SQL database. After adding the required field validator, when I click any button, (be it submit button ot link button or any other button), it shows the required field validator's TEXT i.e...
3
1583
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 completely different task it basically turns on another panel and displays some data. The problem is each time Button2 is pressed required field validator wants the required fields to be filled up. The question is:
2
2250
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 validator is triggered and displays the error message, but it may be up the form so far and out of sight so the user never sees it unless he/she scrolls back up the page. I know there is a validation summary, but it would be nice to have it set focus...
3
2709
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 the user enters some text into a field called "txbName" and when they click on the submit button, if they have not entered anything into the field, a Required Field Validator will say "Invalid Name". Thanks,
3
5079
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 have to enter comments before allowing that page to be submitted. If that cannot be done, what is the best way to do this. What makes it harder is that the questions are being placed on the form from a database dynamically, so we cannot write any...
0
1752
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 am filling the this textbox , it works fine when i am in development server. But whenever i moved my code to hosting server the required field validator stops the form being submitted. If I remove the readonly property on hosting server then it...
0
8473
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8390
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2808
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.