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

Problem in rendering special characters in the cells.

1 Answer 430 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kamal
Top achievements
Rank 1
Kamal asked on 15 May 2014, 09:20 AM
Hi Team

I need to report an issue. I'm using Telerik.Web.UI.RadGrid control in my app. I have some special characters to be rendered in the grid (e.g. ', <, >, \, :, _ etc). When I'm saving these in DB I HTML Encode them. And when rendering back in UI, I HTML Decode them. I found that while HTML Encoding special characters, if there is this combination of characters &# in the encoded string (e.g. for ' [single quote] which becomes &#39;), there is a java script alert message with error "An unknown error occurred while processing the request on the server. The status code returned from the server was: 500". If I remove this &# in the string from back end then it works fine. 

I really need help on this as the special characters are really required in the strings and I cannot go in the entire database remove this &# string combination and thus make the data invalid. Below is more details from the metadata of the control I'm using in my app.

namespace Telerik.Web.UI
{
    [ClientScriptResource("Telerik.Web.UI.RadGrid", "Telerik.Web.UI.Grid.RadGridScripts.js")]
    [ControlValueProperty("SelectedValue")]
    [DefaultEvent("NeedDataSource")]
    [DefaultProperty("")]
    [Description("Telerik RadGrid")]
    [Designer("Telerik.Web.Design.RadGridDesigner, Telerik.Web.Design, Version=2012.3.1016.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4")]
    [EmbeddedSkin("Grid")]
    [EmbeddedSkin("Grid", "Default")]
    [TelerikToolboxCategory("Telerik AJAX Data Components")]
    [ToolboxBitmap(typeof(RadGrid), "Telerik.Web.UI.Grid.png")]
    [ToolboxData("<{0}:RadGrid runat=server></{0}:RadGrid>")]
    public class RadGrid : GridBaseDataList, INamingContainer, IPostBackDataHandler, IPostBackEventHandler, IRadFilterableContainer
    {
........
........
}

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 20 May 2014, 07:22 AM
Hello Kamal,

Page's validation does allow the rendering of special characters (<,>, &, ', ") and in order to resolve the issue in your project you will have to set ValidateRequest="false" in the tag <%@ Page ...%>. Please have in mind that this is not recommended and you will have to make sure that it is safe to disable the validation.

You could also set the customErrors mode to "Off" in your web.config file to see what exactly is causing the issue:
<system.web>
  <customErrors mode="Off"/>
  ...

Please note that this behavior is not likely to be related to our controls. Following is a forum thread regarding the same issue:
Hope that helps.
 


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Kamal
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or