By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,559 Members | 1,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,559 IT Pros & Developers. It's quick & easy.

Submit with validation problem

P: n/a
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
--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us

Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Alphonse,

From your description, you have a simple page which contains two textboxes
and two RequiredFieldValidator
Control to validate textboxes, also a button to submit the page. This
worked well on the dev machine winxp pro
iis5 and also ok on a win2k server machine
but the page can't be submit on a w2k3 machine with IIS6. You also menioned
that you have manually copy the /aspnet_client (clienside scripts) folder
from the other mahcine to the w2k3 server machine, yes?

As for the WebUIValidation.js file under the /aspnet_client root folder ,
it contains the clientside scripts which is required for the ASP.NET
valication control's clientside validation. Also, this file together with
other ASP.NET required clientside resources under the /aspnet_client root
folder can be installed via the "aspnet_regiis.exe" tool.

We should use the
aspnet_regiis -c command
to install the clientside resources for asp.net rather copy from other
machines. For detailed info on the aspnet_regiis tool, you can view the
following referece in msdn:

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

So I sugggest you remove the /aspnet_client folder you manually copyed from
other machines and when to the .net's installed folder
%SYSTEM%\Microsoft.NET\Framework\v1.1.4322\
in commandline
and execute the
aspnet_regiis -c command to reinstall the clienside resources and test
again.

If you have anything unclear or have any new findings, please feel free to
post here. Thanks.
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


Nov 18 '05 #2

P: n/a
Steven,

Thanks for the reply.
If I read the article correctly, Aspnet_regiis.exe must be run from the
command line on the server.
This is not an option as it is a shared commercial host.

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:tS**************@cpmsftngxa10.phx.gbl...
Hi Alphonse,

From your description, you have a simple page which contains two textboxes and two RequiredFieldValidator
Control to validate textboxes, also a button to submit the page. This
worked well on the dev machine winxp pro
iis5 and also ok on a win2k server machine
but the page can't be submit on a w2k3 machine with IIS6. You also menioned that you have manually copy the /aspnet_client (clienside scripts) folder
from the other mahcine to the w2k3 server machine, yes?

As for the WebUIValidation.js file under the /aspnet_client root folder ,
it contains the clientside scripts which is required for the ASP.NET
valication control's clientside validation. Also, this file together with
other ASP.NET required clientside resources under the /aspnet_client root
folder can be installed via the "aspnet_regiis.exe" tool.

We should use the
aspnet_regiis -c command
to install the clientside resources for asp.net rather copy from other
machines. For detailed info on the aspnet_regiis tool, you can view the
following referece in msdn:

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

So I sugggest you remove the /aspnet_client folder you manually copyed from other machines and when to the .net's installed folder
%SYSTEM%\Microsoft.NET\Framework\v1.1.4322\
in commandline
and execute the
aspnet_regiis -c command to reinstall the clienside resources and test
again.

If you have anything unclear or have any new findings, please feel free to
post here. Thanks.
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

Nov 18 '05 #3

P: n/a
Fixed it!

Finally got a friendly tech support person and he installed the client
script files and all works now.

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:tS**************@cpmsftngxa10.phx.gbl...
Hi Alphonse,

From your description, you have a simple page which contains two textboxes and two RequiredFieldValidator
Control to validate textboxes, also a button to submit the page. This
worked well on the dev machine winxp pro
iis5 and also ok on a win2k server machine
but the page can't be submit on a w2k3 machine with IIS6. You also menioned that you have manually copy the /aspnet_client (clienside scripts) folder
from the other mahcine to the w2k3 server machine, yes?

As for the WebUIValidation.js file under the /aspnet_client root folder ,
it contains the clientside scripts which is required for the ASP.NET
valication control's clientside validation. Also, this file together with
other ASP.NET required clientside resources under the /aspnet_client root
folder can be installed via the "aspnet_regiis.exe" tool.

We should use the
aspnet_regiis -c command
to install the clientside resources for asp.net rather copy from other
machines. For detailed info on the aspnet_regiis tool, you can view the
following referece in msdn:

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

So I sugggest you remove the /aspnet_client folder you manually copyed from other machines and when to the .net's installed folder
%SYSTEM%\Microsoft.NET\Framework\v1.1.4322\
in commandline
and execute the
aspnet_regiis -c command to reinstall the clienside resources and test
again.

If you have anything unclear or have any new findings, please feel free to
post here. Thanks.
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

Nov 18 '05 #4

P: n/a
Hi Alphonse,

Really glad to hear that the problem been fixed! Have a good day!

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
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.