Field Validators not working on different server

TommyGun665

Newcomer
Joined
Jul 25, 2003
Messages
10
Location
Toronto. Ontario.Canada
Problem:
Validation is not stoping me from entering blank fields on another server...while the same code on my laptop works correctly.

Description:
The page has two text boxes and a dropdown listbox. The textboxes each have a "Required Field" validation control assigned to them. There is a validationSummary control which displays the actual messages. On my laptop, I can enter nothing in the textboxes, click save...and I'll get the error messages stating the required fields. I copy the ENTIRE code directory (from project up including .aspx, .vb, \bin, etc) just to make sure I'm working with the same stuff...and for some reason doing the same thing on the server...allows the Item to be saved with blank fields.

Environment:
In my environement I am developing from my laptop and implementing on a company web server. On that server I have a "live", "test" and "dev" environment. Dev is a complete copy of the code...the other two are just the binaries and the ASPX pages (and a few other runtime files)
The .NET Framework on each server is Version 1.1.4322 (but strangely enough...under Add/Remove programs they show up as different sizes 38.8MB on the server and 84.5 on laptop...however the laptop has Studio .NET installed so maybe that causes the difference)

I'm really hoping this is one of those "uh...duh" things...and there is an obvious solution. :) I need to get this into testing and soon after that into production...

Thanks,

Tom
 
Field Validation problems: Further things tried

Just wanted to keep you updated on some of the things I've tried to fix this problem:
1) Uninstalled the Visual Studio .NET Architect components that I had on the production server
...to support my earlier plan of developing from that server (Turns out that was way too many difficulties and errors to make happen...so I just treat it like a production server and just copy the complete code to the developement directory and just aspx and binaries plus a few others to the test and live directories)
2) Uninstalled the .NET Framework
...and downloaded the framework 1.1 again and installed it.
The difference in size (Under Control Panel | Add/Remove programs) still shows larger on the development server and the versions are identical. I'm assuming that Visual Studio .NET is responsible for the additional files. That also happens to be the server that "Required Field Validation" controls work on. :(

I'm still trying to find other possible reasons/solutions but I'm quickly running out of things I can do. Does anyone have any suggestions (no matter how far fetched). The workaround is rewriting a LOT of coded pages for how they process field validation. :(

Getting desperate!

Thanks,

Tom
 
Even More: Page Source Differences (javascript)

I've been using the Browser to view the "html source" of the same page on the two different servers. The page I'm viewing is a submit form with "Required Field Validators" for three textboxes.
There is one difference (aside from the encrpyted piece holding control information at the top of the form) and it is with the Javascript function near the end of the page source.

The source from the web server where validation works:
==============================================
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" && clientInformation.appName.indexOf("Explorer") != -1) {
if (typeof(Page_ValidationVer) == "undefined")
alert("Unable to find script library '/aspnet_client/system_web/1_1_4322/WebUIValidation.js'. Try placing this file manually, or reinstall by running 'aspnet_regiis -c'.");
else if (Page_ValidationVer != "125")
alert("This page uses an incorrect version of WebUIValidation.js. The page expects version 125. The script library is " + Page_ValidationVer + ".");
else
ValidatorOnLoad();
}

function ValidatorOnSubmit() {
if (Page_ValidationActive) {
ValidatorCommonOnSubmit();
}
==============================================

The source from the web server where validation does not work:
==============================================
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" && clientInformation.appName.indexOf("Explorer") != -1) {
if ((typeof(Page_ValidationVer) != "undefined") && (Page_ValidationVer == "125"))
ValidatorOnLoad();
}

function ValidatorOnSubmit() {
if (Page_ValidationActive) {
ValidatorCommonOnSubmit();
}
}
==============================================

You can see that the successful one uses different code...seems to check for version of validation script library...but what ever it does...the code generated on one server is different than the other despite both having same version of .NET Framework.

So the development environment has some differences from the production...and that is frustrating. I think I need to try and knock on the gates of Mircrosoft and see if they care about one lowly relatively inexperienced .NET developer with a potential bug?

I'll let you know what I find. :)
 
Sorry to be posting my life (well...bugs life) story here. I hope it helps someone with a similar problem.

I found something on the self support section of Mircrosoft site under developer|.NET Framework
http://msdn.microsoft.com/netframew.../library/en-us/dnnetdep/html/sidexsidenet.asp

It states this:
Terminology
A 1.0 application is an application that targets version 1.0 of the .NET Framework. All applications built with Visual Studio .NET 2002 are 1.0 applications.

A 1.1 application is an application that targets version 1.1 of the .NET Framework. All applications built with Visual Studio .NET 2003 are 1.1 applications.

===========================================
I don't know yet what this means but I think it points out something I forgot to mention with my problem...I'm developing in Visual Studio ..NET 2002 Enterprise Architect...and if I'm reading the above correctly then it requires Framework 1.0 or to expect some incompatibilities with 1.1.

So I noticed on my development server there is actuall a directory for the Framework 1.0 AND for the Framework 1.1.

So I'm going to try uninstalling the 1.1 on the problem server...then installing 1.0...then installing 1.1 again...to simulate what I have on the development server. I'll let you know what happens. I'm still going to submit this to Microsoft if I find a place where I can for free.

Thanks again.
 
OK problem fixed...but a rather puzzling solution. I hope I don't run into problems in the future.

Basically I uninstalled .NET Framework 1.1 from the problem server. Installed .NET Framework 1.0 and then installed .NET Framework 1.1 again. This should have mimicked my development environment. However it still did not function...it would skip my "required field" validation controls. So as a last desperate move I uninstalled the .Net Framework 1.1....and PRESTO it works.

CONCLUSION: It would seem they are rather serious about their statement that Studio 2002 is for Framework 1.0 and Studio 2003 is for framework 1.1.

What still is unkown is why my development server still works even though Framework 1.1 is also installed :( Can't win 'em all. I'm going to uninstall 1.1 from development and see what happens but I guess this thread is finished. Thanks for listening to me vent. {sigh}
 
Semi-hack solution

Tom,

I'm having the same problem. With great chagrin did I read your repeated installations of the Framework.

The problem seems that that VS 2002 with the Framework 1.1 references the script file /aspnet_client/system_web/1_1_4322/ while VS 2003 references /aspnet_client/system_web/1_1_4322_0/.

As I use an external hosting provider, I have asked them to reference the correct script (done using the aspnet_regiis tool specific to each version of the Framework).

However, you can force your application to reference another script version by adding the following tag to the <system.web> section of the web.config file :

<webControls
clientScriptsLocation="/aspnet_client/system_web/1_1_4322_0/"
/>

This will correctly set the reference in the web pages even if you are using a different version of the Framework.

Regards,

Edward Pierce
Azhur Web Architecture
 
Back
Top