This is a migrated thread and some comments may be shown as answers.

[Solved] Javascript Errors in Grid

9 Answers 302 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 18 Apr 2008, 08:57 PM
I'm getting two errors in very specificfic situations when using grids in our application.

1. unterminated string constant
2. Expected ')'

These errors occur in quick succession when I insert a single quote (') character into some form field, have that saved to the database, and then load it back into the grid control.

The thing is the data displays just fine, its just these two errors will show up when a grid containing an item, that contains a single quote character, shows up. As far as I can tell this is a Telerik grid control bug of some kind, has anyone else had this problem (I would gather this would be a common situation)? If not, is there something I'm missing in properly setting up the grids etc to handle single quote characters?

I am using the Telerik 2008 Q1 AJAX ASP.NET controls (trial), this also occurred in the 2007 Q4 controls, I upgraded, hoping this issue would get fixed, but also to have latest and greatest :)

Thanks.

9 Answers, 1 is accepted

Sort by
0
Justin
Top achievements
Rank 1
answered on 18 Apr 2008, 08:59 PM
Quick note, I just tested this in Firefox and it does NOT result in any javascript errors; works perfectly, so this appears to only occur in IE 7.0+ (maybe prior but I dont' have but 7.0 available).

Thanks again.
0
Maria Ilieva
Telerik team
answered on 21 Apr 2008, 04:03 PM
Hello Justin,

Please note that the presented error is not directly related to our controls. Refer to the following forum post, which elaborates on the matter.

Regards,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Justin
Top achievements
Rank 1
answered on 24 Apr 2008, 12:55 PM
The issue I am having is with a single 'quote' character, the very quote used to quote the word quote.

That link doesn't elaborate on anything related to whats going on with my Telerik grid, I'm not having issues with spaces, only single quote characters.
0
Maria Ilieva
Telerik team
answered on 29 Apr 2008, 04:58 AM
Hi Justin,

Actually the presented error is not directly connected to RadControls. The error means that you have put a string (text in quotes) and forgot the ending quote. Please review the following forum post, which should help you on this matter.

All the best,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Dathan
Top achievements
Rank 1
answered on 28 Oct 2008, 03:46 AM
This continues to be an issue, and is definitely a Telerik problem.  The code generated by the grid for the filter menu processes the filter with the following code if I enter a'b (an 'a' followed by an apostrophe followed by a 'b') into the filter box:

__doPostBack('ctl00$ctl00$ContentPlaceHolder1$UserGrid$ctl00;Filter;FullName|a'b|Contains')

You can see the literal in the post and it's clear why it would cause an issue.  The string needs to be escaped or captured into/from a variable.

Are there any suggested workarounds for this issue until a fix is available?
0
Rosen
Telerik team
answered on 28 Oct 2008, 04:10 PM
Hi Dathan,

We will do our best to address this issue for this year's Q3 release of RadControls for ASP.NET AJAX, expected in the middle of the next week. Please excuse us for any inconvenience this may caused you. In the meantime you may consider escaping the single quote symbol manually.

Best regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Kent
Top achievements
Rank 1
answered on 01 Dec 2008, 04:55 PM
I was having this problem using the RadGrid for ASP.NET AJAX Q3 2008.  But I fixed it by editing the column names in the stored procedure I call to populate the grid.  In Server Management Studio (using SQL Server 2005), I changed the  AS [Project Name] to  AS 'Project Name'.  Alternatively, [Project_Name] worked also.  Your mileage may vary.

Hope this was helpful.
Kent Stairley
Bent Oak Technologies, LLC
0
Laura
Top achievements
Rank 1
answered on 20 Apr 2009, 06:21 PM
I am using Q3 2008 release, and I am getting the error: Expected ')' when I filter using the ' character.

For example I am looking for the word investor's so I enter into the filter box:  investor\'s

and this give me the javascript error Expected ')'

Was this not fixed in Q3 2008?

0
Daniel
Telerik team
answered on 20 Apr 2009, 07:53 PM
Hello Laura,

I suggest you download the latest internal build from the following link:
Latest internal builds

Let us know if the problem still persists.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Justin
Top achievements
Rank 1
Maria Ilieva
Telerik team
Dathan
Top achievements
Rank 1
Rosen
Telerik team
Kent
Top achievements
Rank 1
Laura
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or