Problems with Validator controls

J

John Holmes

I'm using the RequiredFieldValidator on 9 text boxes and then a Validation
Summary control for bringing up a message when the user tries to click a
button that makes a trip to the server. This works fine on my development
machine, but when I copy the project to my test web server the required
validation doesn't occur and the summary dialog doesn't come up. The user is
allowed to click the button and it processes the event code on the server
just like there are no Required Field Validator controls. I'm not sure why
it would work on my machine, but not on the test web server. I think at one
point I had it working on the test web server, too. Any ideas for trying to
solve this will be much appreciated.

One other question about the Validator controls. Is there a way to suppress
the error messages from the individual controls and have the user just see
the summary dialog. That's what I'd really like. I don't like having to
provide real estate on my form for each field showing the errors.

Thanks,

John Holmes
(e-mail address removed)
 
S

Steven Cheng[MSFT]

Hi John,

Thanks for posting in the community!
From your description, you used RequiredFieldValidator controls and
ValidatioSummary control on a certain ASP.NET webpage to ensure the input
of some certain ASP.NET TEXTBOX server controls. However, you found the
validiton worked on your dev machine but not work on a test server machine
and also you wonder how to only show the validateSummary's message rather
than also display the individual required validator's message ,yes?

As for the first problem, I'd like to confirm on some further questions:
1. Are the RequiredValidators all set as EnableClientScript = true ? If so,
try set it as false to see whether the serverside validation work on both
machine.(I think it should work).

2. If # works , there seems have some problems with the ASP.NET buildin
clientside scripts on the test servermachine. Are the dotnet framework's
version same with the two machines? If so, I think you can try reinstalling
the ASP.NET buildin clientside script resources. Just open the Visual
Studio.net command prompt , througth the following steps:
Visual Studio.NET -->Visual Studio.NET tools --> Visual Studio.NET Command
prompt
Then in the command line window, type:
aspnet_regiis -c
this will reinstall the client-side scripts for ASP.NET, such as
client-side validation scripts, to the aspnet_client subdirectory of each
IIS site directory. For detailed info on the tool, you can view the
following reference in MSDN:

#ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfASPNETIISRegistrat
ionToolAspnet_regiisexe.asp?frame=true

As for the second question --- only show the "validationSummary" control's
message, I think you can use the RequiredFieldValidator control's "Display"
property, try setting it to "none" in the propety window. Then, the
RequiredFieldvalidator's own error message won't be displayed.

Please check out the above suggestions. If you have any further questions
or new findings, please feel free to post here.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top