A
Alphonse Giambrone
I have a simple login page that has two text boxes, two
requiredfieldvalidators, a couple of labels and a button. It has been
reduced down to almost nothing to troubleshoot the below problem.
Added to a project on development machine (Win XP Pro, IIS 5.1, CLR
1.1.4322), works fine.
Deployed to a shared web host (IIS 5.1, CLR 1.1.4322), works fine.
Added to different project on same development machine, works fine.
Deployed to 2nd shared host (IIS 6.0, CLR 1.1.4322), FORM DOES NOT SUBMIT!
Validators seem to be working as if I leave a textbox empty, the
validator(s) present the appropriate message and there is no message if
textboxes are filled in.
It seems to be a problem with the generated javascript.
I added "/aspnet_client/system_web/1_1_4322/WebUIValidation.js" to the
application root because I need to utilize functions in it.
This is the same for all instances.
I mention this because if I remove the js file, the form will submit
properly, but then my other pages that need it don't work.
Here is the generated page source (minus most of the html) from the host
where the page does NOT submit:
<body onload="document.frmLogin.txtUserName.focus();">
<form name="frmLogin" method="post" action="logina.aspx"
language="javascript" onsubmit="if (!ValidatorOnSubmit()) return false;"
id="frmLogin">
<script language="javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>
<script language="javascript">
<!--
var Page_Validators = new Array(document.all["RequiredFieldValidator1"],
document.all["RequiredFieldValidator2"]);
// -->
</script>
<script language="javascript">
<!--
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) {
return ValidatorCommonOnSubmit();
}
return true;
}
// -->
</script>
</form>
</body>
==================================================
Here is the generated page source (minus most of the html) from the host
(and my development machine) where the page DOES submit:
<body onload="document.frmLogin.txtUserName.focus();">
<form name="frmLogin" method="post" action="logina.aspx"
language="javascript" onsubmit="ValidatorOnSubmit();" id="frmLogin">
<script language="javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>
<script language="javascript">
<!--
var Page_Validators = new Array(document.all["RequiredFieldValidator1"],
document.all["RequiredFieldValidator2"]);
// -->
</script>
<script language="javascript">
<!--
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();
}
}
// -->
</script>
</form>
</body>
============================================================
The differences I see are in the form's submit event and the function
ValidatorOnSubmit().
Does anyone understand what is going on?
How to solve?
TIA
requiredfieldvalidators, a couple of labels and a button. It has been
reduced down to almost nothing to troubleshoot the below problem.
Added to a project on development machine (Win XP Pro, IIS 5.1, CLR
1.1.4322), works fine.
Deployed to a shared web host (IIS 5.1, CLR 1.1.4322), works fine.
Added to different project on same development machine, works fine.
Deployed to 2nd shared host (IIS 6.0, CLR 1.1.4322), FORM DOES NOT SUBMIT!
Validators seem to be working as if I leave a textbox empty, the
validator(s) present the appropriate message and there is no message if
textboxes are filled in.
It seems to be a problem with the generated javascript.
I added "/aspnet_client/system_web/1_1_4322/WebUIValidation.js" to the
application root because I need to utilize functions in it.
This is the same for all instances.
I mention this because if I remove the js file, the form will submit
properly, but then my other pages that need it don't work.
Here is the generated page source (minus most of the html) from the host
where the page does NOT submit:
<body onload="document.frmLogin.txtUserName.focus();">
<form name="frmLogin" method="post" action="logina.aspx"
language="javascript" onsubmit="if (!ValidatorOnSubmit()) return false;"
id="frmLogin">
<script language="javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>
<script language="javascript">
<!--
var Page_Validators = new Array(document.all["RequiredFieldValidator1"],
document.all["RequiredFieldValidator2"]);
// -->
</script>
<script language="javascript">
<!--
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) {
return ValidatorCommonOnSubmit();
}
return true;
}
// -->
</script>
</form>
</body>
==================================================
Here is the generated page source (minus most of the html) from the host
(and my development machine) where the page DOES submit:
<body onload="document.frmLogin.txtUserName.focus();">
<form name="frmLogin" method="post" action="logina.aspx"
language="javascript" onsubmit="ValidatorOnSubmit();" id="frmLogin">
<script language="javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>
<script language="javascript">
<!--
var Page_Validators = new Array(document.all["RequiredFieldValidator1"],
document.all["RequiredFieldValidator2"]);
// -->
</script>
<script language="javascript">
<!--
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();
}
}
// -->
</script>
</form>
</body>
============================================================
The differences I see are in the form's submit event and the function
ValidatorOnSubmit().
Does anyone understand what is going on?
How to solve?
TIA