• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

Problem with asp.net Validators

Hello everyone, I have a problem with the asp.net RequiredFieldValidator.
I want the validators to run on the client side so I have left the EnableClientScript property set to True.
On my local server, everything is going right and if I try to add data in the WebForm the validators are launched on the client side (using JavaScript) without submitting to the server.
Now I have uploaded my application on a Web Server and the forn submits to the server without using the client side validation.
Any Idea about that strange problem?
0
niazid
Asked:
niazid
2 Solutions
 
warmachCommented:
Does the client have Javascript turned on in their browser?
0
 
SteveGTRCommented:
If you run the web form from the server does it give you any more information? I had a problem where smartnavigation wasn't working. When I ran the web form on the server it came up with an error stating it couldn't find the SmartNav.js and WebUIValidation.js files.

It turns out the access properties for the inetnet\asp_client were set incorrectly.

Good Luck,
Steve
0
 
nishikanthCommented:
go to the server and run
C:\WINDOWS\Microsoft.NET\Framework\vn.n.nnnn>aspnet_regiis.exe -c

which vn.n.nnnn is the .NET framework version that you use on the server.

It will install client side script for you.


Do you use Netscape. Validators do not work on Browsers other than IE.  other things do not render properly in Netscape, which may expalin why Netscape is not a very popular Browser.

But check for page.isValid before doing any transaction.... thought the validations may not work on the client side, it will surely work on serve side, and will check for errors.

I personally avoid Netscape like the plague, and advise everyone else to do likewise.

actually the validation will work either in ie or in netscape. however, only ie has the functionality to validate data on the clientside. aspx code on netscape will perform only server validation only. that's why the validation is kinda different.

to make it work properly, you have to check for Page.IsValid before performing any operation that requires validation in codebehind.
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
niazidAuthor Commented:
The problem was that our host has two versions of the .Net Framework and the "asp_client" folder contains only "WebUIValidation.js" corresponding to the older Framework. We asked them to copy the newer WebUIValidation.js file and it has worked.
the tip of nishikanth about "aspnet_regiis.exe -c" was useful, same thing for the tip of SteveGTR, so I will split the points between them

0
 
SteveGTRCommented:
Well that's about what both nishikanth and I posted in my response. The C grade is unwarrented...
0
 
niazidAuthor Commented:
SteveGTR, excuse me but I didn't notice the grade matter, it was given accidentely.
0
 
SteveGTRCommented:
I posted a message to have the grade changed.
0
 
niazidAuthor Commented:
SteveGTR, I have accepted the answer and I think it's impossible to change the grade!
0
 
SteveGTRCommented:
Thanks Netminder :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now