RadEditor ImageManager throwing a Parse Exception

5 posts, 0 answers
  1. Tono
    Tono avatar
    7 posts
    Member since:
    Nov 2013

    Posted 12 Nov 2013 Link to this post

    Hi

    We are using Telerik RadEditor in our web application, but some pretty features (like all the editors, ImageEditor, FlashEditor, ...) are not working. The only working editor is LinkEditor, so we had to disable the other editors.

    We are using Telerik.Web.UI_2013_3_1015_Dev, Visual studio 2010.
    The problem is, that when I try to create a simple web application with RadEditor, everything works fine, but when I use it in our complex company application, the editors don't work.
    I've tried to add some lines into web.config, but it didn't help.

      <httpHandlers>
       <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI"/>
       <add verb="*" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"></add>
       <add verb="*" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"></add>
       <add verb="*" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/>
       <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false"/>
      </httpHandlers>
      </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
          <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
          <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" preCondition="managedHandler"/>
        </modules>
        <handlers>
          <add name="ChartImage.axd_*" path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode"/>
          <add name="Telerik.Web.UI.SpellCheckHandler.axd_*" path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode"/>
          <add name="Telerik.Web.UI.DialogHandler.aspx_*" path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode"/>
          <add name="Telerik.RadUploadProgressHandler.ashx_*" path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" preCondition="integratedMode"/>
          <add name="Telerik.Web.UI.WebResource.axd_*" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode"/>
        </handlers>
      </system.webServer>

    //this is needed, otherwise I'm not able to run the application with radEditor
      <runtime>
          <dependentAssembly>
            <assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-2013.3.1015.40" newVersion="2013.3.1015.40" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>

    Code behind:
    (called if !PostBack)

    //hack solution - because of RadEditor bug in IE9 with br tags
            RadEditor1.DisableFilter(EditorFilters.ConvertToXhtml)

            RadEditor1.Content = string.Empty;
           
            RadEditor1.EditModes = EditModes.Design | EditModes.Preview;
           
            RadEditor1.LocalizationPath = "~/App_GlobalResources/RadEditor/en";
            RadEditor1.ToolsFile = "~/App_GlobalResources/RadEditor/Tools/FullSetTools.xml";



    Markup:
    <telerik:RadEditor runat="server" ID="RadEditor1"
     Language="en-US" EnableResize="false" SkinID="DefaultSetOfTools" Height="300px" Width="98%">
    </telerik:RadEditor>

    I can't send you more of the code because of our company rules.
    Can you please help with some hacks or settings in web.config ?

    Thank you
    T

    When I try to open ImageEditor, I get this Exception:

    Server

     

    Error in '/' Application.

    --------------------------------------------------------------------------------

    Expression expected

    Description:

     

    An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception

    Details: Telerik.Web.UI.ParseException: Expression expected

    Source

     

    Error:

    An unhandled exception was generated during the execution

    of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack

    Trace:

    [ParseException: Expression expected]

    Telerik

    .Web.UI.ExpressionParser.ParsePrimaryStart() +245

    Telerik

    .Web.UI.ExpressionParser.ParsePrimary() +47

    Telerik

    .Web.UI.ExpressionParser.ParseUnary() +406

    Telerik

    .Web.UI.ExpressionParser.ParseMultiplicative() +54

    Telerik

    .Web.UI.ExpressionParser.ParseAdditive() +54

    Telerik

    .Web.UI.ExpressionParser.ParseComparison() +69

    Telerik

    .Web.UI.ExpressionParser.ParseLogicalAnd() +49

    Telerik

    .Web.UI.ExpressionParser.ParseLogicalOr() +49

    Telerik

    .Web.UI.ExpressionParser.ParseExpression() +74

    Telerik

    .Web.UI.ExpressionParser.Parse(Type resultType) +76

    Telerik

    .Web.UI.DynamicExpression.ParseLambda(ParameterExpression[] parameters, Type resultType, String expression, Object[] values) +92

    Telerik

    .Web.UI.DynamicExpression.ParseLambda(Type itType, Type resultType, String expression, Object[] values) +132

    Telerik

    .Web.UI.GridDynamicQueryable.Where(IQueryable source, String predicate, Object[] values) +235

    Telerik

    .Web.UI.GridDataTableFromEnumerable.FillData35() +3952

    Telerik

    .Web.UI.GridDataTableFromEnumerable.FillData() +1078

    Telerik

    .Web.UI.GridResolveEnumerable.Initialize() +58

    Telerik

    .Web.UI.GridResolveEnumerable.EnsureInitialized() +45

    Telerik

    .Web.UI.GridResolveEnumerable.get_DataTable() +36

    Telerik

    .Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, DataView dataView, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +245

    Telerik

    .Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +109

    Telerik

    .Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +188

    Telerik

    .Web.UI.GridTableView.get_ResolvedDataSource() +256

    Telerik

    .Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +340

    System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +117

    System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +205

    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +131

    System.Web.UI.WebControls.DataBoundControl.PerformSelect() +233

    Telerik

    .Web.UI.GridTableView.PerformSelect() +38

    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +140

    Telerik

    .Web.UI.GridTableView.DataBind() +389

    Telerik

    .Web.UI.RadGrid.DataBind() +191

    Telerik

    .Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +4246

    Telerik

    .Web.UI.RadGrid.Rebind() +71

    Telerik

    .Web.UI.FileExplorer.FileList.UpdateLocalization() +631

    Telerik

    .Web.UI.FileExplorer.FileList.ControlsPreRender() +244

    Telerik

    .Web.UI.RadFileExplorer.ControlPreRender() +549

    Telerik

    .Web.UI.RadWebControl.OnPreRender(EventArgs e) +47

    System.Web.UI.Control.PreRenderRecursiveInternal() +239

    System.Web.UI.Control.PreRenderRecursiveInternal() +337

    System.Web.UI.Control.PreRenderRecursiveInternal() +337

    System.Web.UI.Control.PreRenderRecursiveInternal() +337

    System.Web.UI.Control.PreRenderRecursiveInternal() +337

    System.Web.UI.Control.PreRenderRecursiveInternal() +337

    System.Web.UI.Control.PreRenderRecursiveInternal() +337

    System.Web.UI.Control.PreRenderRecursiveInternal() +337

    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5044


  2. Tono
    Tono avatar
    7 posts
    Member since:
    Nov 2013

    Posted 12 Nov 2013 Link to this post

    I forgot to mention, that setting the ViewPaths of the ImageManager didn't help, but I don't think, that setting the ViewPaths property is mandatory.

    var viewImages = new [] { "~/Images" };
    RadEditor1.ImageManager.ViewPaths = viewImages;

    We are using IE9.
  3. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 14 Nov 2013 Link to this post

    Hi Tono,

    I am unable to reproduce the problem on my end, it would be helpful if you could be able to get back to me with more details about the scenario in which the dialogs appears broken. For example in the exception provided I can see that a Grid control is used, although I can only make assumptions on the specific scenario.

    Note that it would be very useful if you are able to provide a simple project, which isolates the problem, so that I could run and investigate it locally. 

    Regards,
    Ianko
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  4. Tono
    Tono avatar
    7 posts
    Member since:
    Nov 2013

    Posted 19 Nov 2013 Link to this post

    Hi

    I can't create a simple project which contains the error I've mentioned above, because I can't find the part in our application, that is causing the problem. I have simple project with RadEditor, but it works very well, so there's no reason to send it to you. But...
    We've figured out, what was the first problem (yes, there is more): It was our Resource provider. We are using our own resource provider and everytime, when key contained "ReservedResource", the resource provider returned our default NotLocalizedText. That caused, that when Telerik Expression.ParserPrimaryStart method tried to test this condition "switch (this.token.id)", it ended in "default:" part of the switch, because token.id was "Question". We updated our Resource provider and now the managers don't throw an exception but show a dialog window. But...
    ImageManager: When I try to insert selected image, our application stoppes on javascript with this error: "Microsoft JScript runtime error: Object doesn't support property or method 'cloneNode'"
    The javascript part is: getOuterHtml:function(b){if(b.outerHTML){return b.outerHTML;}else{var a=b.cloneNode(true); (b is HTMLImageElement)
    The other thing is, that when I try to add picture into Image Map editor using Image Manager, it does nothing. Althoug I click the Insert button in Image manager, but nothing is added into Image Map editor.

    It works in my simple test application, so it is probably another problem specific for our application, but the javascript is from Telerik, so maybe you have a clue, what can be behind this errors.

    Thank you
    TP
  5. Tono
    Tono avatar
    7 posts
    Member since:
    Nov 2013

    Posted 19 Nov 2013 Link to this post

    We got it, I hope !
    It was in the version of Telerik.Web.UI.dll.
    We used version 2013.01.417, but version 2013.3.1015.40 did the job.

    Adding images using ImageManager now works and adding them into Image Map editor using the ImageManager works too.
Back to Top