Why Microsoft Examples generate error on IIS with .net 1.1: Issue with Validator Control

S

Support

Hello:
I used the code in the first example from:
http://support.microsoft.com/default.aspx?scid=kb;en-us;316712
I get an "error on the page" line 4 char 1 syntax error Code:0 test.aspx
The folder where it is running has the following as the default script for
aspx:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll

So, I am running .Net 1.1 on a win 2000 machine with IIS. I am using IE
version 6.0.2800.1106.xpsp2.030422-1633
It also has asp.net version 1.0 installed
What's wrong.


Apparently the error is generated by the validator code:
<asp:RequiredFieldValidator
id="RequiredfieldvalidatorHeight"
ControlToValidate="txtHeight"
ErrorMessage="Height field is empty"
Display="Static"
InitialValue="" Width="100%"
runat=server></asp:RequiredFieldValidator>
So, when I remove it, the error goes away.
Thanks for your help
Terry
 
E

Eric Lawrence [MSFT]

What HTML is being sent back to the browser?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Support

Here it is:
----------------------------------------------------------------------------
----------------------
<html>
<body>
<form name="form1" method="post" action="test.aspx"
language="javascript" onsubmit="ValidatorOnSubmit();" id="form1">
<input type="hidden" name="__VIEWSTATE"
value="dDwtOTQ3NjUyMzM3Ozs+FAU8awA8fH42Zj9JvvtQNIY51lE=" />

<script language="javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>



<span id="lblName">First Name:</span>
<input name="txtName" type="text" id="txtName" />
<span id="RequiredFieldValidatorName"
controltovalidate="txtName" errormessage="First Name field is empty"
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue=""
style="color:Red;width:100%;visibility:hidden;">First Name field is
empty</span><br>

<span id="lblAge">Age:</span>
<input name="txtAge" type="text" id="txtAge" />
<span id="RequiredfieldvalidatorAge"
controltovalidate="txtAge" errormessage="Age field is empty"
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue=""
style="color:Red;width:100%;visibility:hidden;">Age field is
empty</span><br>

<span id="lblHeight">Height:</span>
<input name="txtHeight" type="text" id="txtHeight" />
<span id="RequiredfieldvalidatorHeight" controltovalidate="txtHeight"
errormessage="Height field is empty"
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue=""
style="color:Red;width:100%;visibility:hidden;">Height field is empty</span>

<span id="RangeValidatorHeight" controltovalidate="txtHeight"
errormessage="Incorrect value for the height field" type="Integer"
evaluationfunction="RangeValidatorEvaluateIsValid" maximumvalue="10"
minimumvalue="1" style="color:Red;width:100%;visibility:hidden;">Incorrect
value for the height field</span><br>

<div id="valSum" headertext="Summary of Validation Errors:"
style="color:Red;font-family:verdana;font-size:12pt;display:none;">

</div><br>

<input type="submit" name="btnValidate" value="Validate"
onclick="if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate(); " language="javascript" id="btnValidate" />

<script language="javascript">
<!--
var Page_ValidationSummaries = new Array(document.all["valSum"]);
var Page_Validators = new
Array(document.all["RequiredFieldValidatorName"],
document.all["RequiredfieldvalidatorAge"],
document.all["RequiredfieldvalidatorHeight"],
document.all["RangeValidatorHeight"]);
// -->
</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>
</html>
 
E

Eric Lawrence [MSFT]

Hrm... this HTML works just fine on my server. Have you tried accessing this
from a different machine?

Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

Support said:
Here it is:
-------------------------------------------------------------------------- --
----------------------
<html>
<body>
<form name="form1" method="post" action="test.aspx"
language="javascript" onsubmit="ValidatorOnSubmit();" id="form1">
<input type="hidden" name="__VIEWSTATE"
value="dDwtOTQ3NjUyMzM3Ozs+FAU8awA8fH42Zj9JvvtQNIY51lE=" />

<script language="javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>



<span id="lblName">First Name:</span>
<input name="txtName" type="text" id="txtName" />
<span id="RequiredFieldValidatorName"
controltovalidate="txtName" errormessage="First Name field is empty"
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue=""
style="color:Red;width:100%;visibility:hidden;">First Name field is
empty</span><br>

<span id="lblAge">Age:</span>
<input name="txtAge" type="text" id="txtAge" />
<span id="RequiredfieldvalidatorAge"
controltovalidate="txtAge" errormessage="Age field is empty"
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue=""
style="color:Red;width:100%;visibility:hidden;">Age field is
empty</span><br>

<span id="lblHeight">Height:</span>
<input name="txtHeight" type="text" id="txtHeight" />
<span id="RequiredfieldvalidatorHeight" controltovalidate="txtHeight"
errormessage="Height field is empty"
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue=""
style="color:Red;width:100%;visibility:hidden;">Height field is
empty said:
<span id="RangeValidatorHeight" controltovalidate="txtHeight"
errormessage="Incorrect value for the height field" type="Integer"
evaluationfunction="RangeValidatorEvaluateIsValid" maximumvalue="10"
minimumvalue="1" style="color:Red;width:100%;visibility:hidden;">Incorrect
value for the height field</span><br>

<div id="valSum" headertext="Summary of Validation Errors:"
style="color:Red;font-family:verdana;font-size:12pt;display:none;">

</div><br>

<input type="submit" name="btnValidate" value="Validate"
onclick="if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate(); " language="javascript" id="btnValidate" />

<script language="javascript">
<!--
var Page_ValidationSummaries = new Array(document.all["valSum"]);
var Page_Validators = new
Array(document.all["RequiredFieldValidatorName"],
document.all["RequiredfieldvalidatorAge"],
document.all["RequiredfieldvalidatorHeight"],
document.all["RangeValidatorHeight"]);
// -->
</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>
</html>
-------------------------------------------------------------------------- --
-----------------------------
Straight from the web site....
Thank you
TErry
Support said:
Hello:
I used the code in the first example from:
http://support.microsoft.com/default.aspx?scid=kb;en-us;316712
I get an "error on the page" line 4 char 1 syntax error Code:0 test.aspx
The folder where it is running has the following as the default script for
aspx:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll

So, I am running .Net 1.1 on a win 2000 machine with IIS. I am using IE
version 6.0.2800.1106.xpsp2.030422-1633
It also has asp.net version 1.0 installed
What's wrong.


Apparently the error is generated by the validator code:
<asp:RequiredFieldValidator
id="RequiredfieldvalidatorHeight"
ControlToValidate="txtHeight"
ErrorMessage="Height field is empty"
Display="Static"
InitialValue="" Width="100%"
runat=server></asp:RequiredFieldValidator>
So, when I remove it, the error goes away.
Thanks for your help
Terry
 

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

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top