BUG: JScript Compilation Error '800a03ec' Expected ';'ID: Q190940
|
On an Active Server Pages (ASP) page with a Grid you get the following error:
On a DHTML page with a Grid, only the navbar and paging information (Page x of n) appears. Or as a DHTML page is loading you get an "Internet Explorer Script Error" dialog box containing text that is similar to the ASP error above.Microsoft JScript compilation error '800a03ec'
Expected ';'
/ShipTest/_ScriptLibrary/DataGrid.ASP, line 197
This error occurs because an apostrophe was entered in the Header for the
Grid. The header input text box can be found on the Custom property pages
of the Grid on the Data tab in the Edit columns section.
The Grid is implemented in JavaScript. In JavaScript the apostrophe (') is
a string delimiter as is a double-quote ("). The Grid uses apostrophes as
string delimiters internally.
To get an apostrophe to appear in the Header of the grid you need to put two backslash (\\) characters before an apostrophe. This will cause the apostrophe to appear as you would expect. This is also known as escaping the apostrophe (see below for more information on escaping in JavaScript and the DTC Grid).
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
Normally in JavaScript you would need only one backslash (\) to escape an apostrophe. In this case you need two because the string is processed twice: first when it is evaluated as a JavaScript expression and second when it is stored as a string using apostrophes as delimiters. If you type in Name\\'s it is processed once and stored in the Grid's internal properties as "Name\'s'. This will be put into the Grid as Name's, which is what we want.
Additional query words:
Keywords : kbVisID600 kbVisID600bug kbGrpASP
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 24, 1999