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

Unterminated string error due to foreign key string containing single quote

2 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 10 Sep 2012, 10:48 PM
I'm attempting to use a foreign key column and I sometimes get an unterminated string error while loading the page.  I determined that this is due to having a single quote in the data (not uncommon for users to do that).

This is easy to duplicate using the MVC Example project by simply changing an Employee name in the Northwind database to contain a single quote.  The Grid Foreign Key demo will show the error.  (BTW, Firefox doesn't really indicate the error, it just stops.  IE blows up.)

Encoding the string doesn't help.  The resulting data simply shows the ' value in the output.

Anyone else have a similar problem?

2 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 13 Sep 2012, 03:15 PM
Hi David,


Thank you for bringing this issue to our attention. I have informed our dev team about it and it is now fixed. At the end of the week there will be service pack which will also include this fix.


As a small sign of our appreciation I have updated your Telerik points.


Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mathieu
Top achievements
Rank 1
answered on 15 Oct 2012, 09:29 PM
I have the same problem and I'm using the Kendo.Mvc wrapper version 2012.2.710. Reproducing the problem is quite simple, below the Model.Shops is an IEnumerable of SelectListItem:

.ForeignKey(x => x.ShopId, Model.Shops, "Value", "Text");

When an item has single quotes in the Text field I get an unexpected token illegal error in Chrome. Is there any temporary fix I can use?

Thanks!
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Mathieu
Top achievements
Rank 1
Share this question
or