From: Luigi on
Hi all,
in my ASP.NET 3.5 application I'm having this javascript error when I open
some pages:


User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0;
SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media
Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Mon, 15 Mar 2010 11:12:39 UTC


Message: Expected ';'
Line: 206
Characted: 45
Code: 0
URI: mypath

and if I click F12 in IE8 to view the source of the page, the line 206
begins with:

var

WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID
= document.all ?
document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID"]
:
document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID");

in the code:



<script type="text/javascript">
//<![CDATA[
var
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.controltovalidate =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.display =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.evaluationfunction =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.validationexpression =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID
= document.all ?
document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID"]
:
document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID");"WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";"Dynamic";"RegularExpressionValidatorEvaluateIsValid";"^\\s*(\\d{1,2})([-./])(\\d{1,2})\\2((\\d{4})|(\\d{2}))\\s*$";

var
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.controltovalidate =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.errormessage =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.display =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.evaluationfunction =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.initialvalue =
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID
= document.all ?
document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID"]
:
document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID");"WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";"Campo
[Data] obbligatorio";"None";"RequiredFieldValidatorEvaluateIsValid";"";

var
WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1.showmessagebox =
WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1.showsummary
=
WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1 =
document.all ?
document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1"]
:
document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1");"True";"False";
//]]>
</script>

How can I solve this problem?

Thanks in advance.

Luigi

From: Mark Rae [MVP] on
"Luigi" <Luigi(a)discussions.microsoft.com> wrote in message
news:F5ABE952-7798-4A5A-8852-564188A13834(a)microsoft.com...

> = document.all ?

http://javascript.about.com/od/hintsandtips/a/worst_4.htm

I appreciate that you're trying to evaluate whether document.all is
supported or not by the browser, but there's really no need to do this
anymore, as all modern browsers fully support document.getElementById(....)


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

From: Patrice on
Hello,

> <script type="text/javascript">
> //<![CDATA[
> var
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.controltovalidate
> =
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.display
> =
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.evaluationfunction
> =
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.validationexpression
> =
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID
> = document.all ?
> document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID"]
> :
> document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID");"WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";"Dynamic";"RegularExpressionValidatorEvaluateIsValid";"^\\s*(\\d{1,2})([-./])(\\d{1,2})\\2((\\d{4})|(\\d{2}))\\s*$";
>

The statement ends after ...
document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID");

Then the next statement is :
"WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";

--
Patrice



From: Luigi on
"Mark Rae [MVP]" wrote:

> "Luigi" <Luigi(a)discussions.microsoft.com> wrote in message
> news:F5ABE952-7798-4A5A-8852-564188A13834(a)microsoft.com...
>
> > = document.all ?
>
> http://javascript.about.com/od/hintsandtips/a/worst_4.htm
>
> I appreciate that you're trying to evaluate whether document.all is
> supported or not by the browser, but there's really no need to do this
> anymore, as all modern browsers fully support document.getElementById(....)

In the Production environment, there is IE 6.
In my machine I have the version 8.0.
Maybe is here the problem?

Luigi
From: Luigi on
"Patrice" wrote:

> The statement ends after ...
> document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID");
>
> Then the next statement is :
> "WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";

Yes, the complete script is:


<script type="text/javascript">
//<![CDATA[
var
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID
= document.all ?
document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID"]
:
document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID");
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.controltovalidate
= "WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.display = "Dynamic";
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID.validationexpression
= "^\\s*(\\d{1,2})([-./])(\\d{1,2})\\2((\\d{4})|(\\d{2}))\\s*$";
var
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID
= document.all ?
document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID"]
:
document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID");
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.controltovalidate
= "WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.errormessage = "Campo [Data] obbligatorio";
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.display = "None";
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidatorID.initialvalue = "";
var WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1 =
document.all ?
document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1"]
:
document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1");
WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1.showmessagebox = "True";
WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1.showsummary
= "False";
//]]>
</script>