Error with images

Last post 12-26-2012, 6:31 PM by burley325. 8 replies.
Sort Posts: Previous Next
  •  09-27-2012, 3:36 PM 74795

    Error with images

    Hi,

     

    I'm testing Rich Text Editor but ran in to some problems.

    When I try to insert an image, when I click on the "Insert Image" icon the dialog is displayed but then a second dialog is shown with the subject "Alert" and the message is all the html code on the page. If I close the second dialog and click on the upload icon I get the following error: 

     

    Alert
    Unable to parse /Scripts/richtexteditor/dialogs/uploadinfo.xml?2012092301 , failed to execute initialize : [uploadinfodialog:1] , option.storage is undefined, 

    I have done all settings according to the installation, I've added paths to temp directories etc. It doesn't work on my local computer or on the server running IIS7.5 in Integrated mode

  •  09-27-2012, 3:52 PM 74797 in reply to 74795

    Re: Error with images

    In Firefox I get this error:

    1. Fel: Error: http error2 :<!DOCTYPE html>  
    2. <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->  
    3. <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="sv"> <![endif]-->  
    4. <!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="sv"> <![endif]-->  
    5. <!--[if IE 8]>    <html class="no-js lt-ie9" lang="sv"> <![endif]-->  
    6. <!--[if gt IE 8]><!-->  
    7. <html class="no-js" lang="sv">  
    8. <!--<![endif]-->  
    9. <head>  
    10.     <meta charset="utf-8" />  
    11.     <title>Skapa nyhet</title>  
    12.     <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />  
    13.       
    14.     <meta name="viewport" content="width=device-width, initial-scale=1" />  
    15.     <link href="/Content/foundation/AdminFoundation.css" rel="stylesheet"/>  
    16.   
    17.    
    18. //etc all html code in the file  
    19.   
    20. Källkodsfil: http://www.mydomain.se/Scripts/richtexteditor/scripts/loader.js  
    21.   
    22. Rad: 72   

     

     Row 72 is:

     runcode=new Function("","eval(arguments[0])");
    It's from this code:

     var xh=createxh(); xh.open("GET",url,true); xh.onreadystatechange=function() { if(xh.readyState!=4)return; xh.onreadystatechange=new Function("",""); setTimeout(runcallbacks,0); if(xh.status!=200) { item.succeed=false; item.loading='httperror:'+xh.status; throw(new Error("failed to load "+url+" , \r\n http"+xh.status)); } try { var code=xh.responseText; if(!runcode) runcode=new Function("","eval(arguments[0])"); runcode(code); item.loading=null; } catch(x) { item.loading='scripterror:'+x.message; throw(new Error("failed to load "+url+" , \r\n"+x.message)); } } xh.send(""); } 
     

  •  09-27-2012, 4:22 PM 74798 in reply to 74795

    Re: Error with images

    Hi Aleborg,

     

    Can you show me what you set for the  temp directory?

     

    can you use all the default settings of the Rich TextEditor? does it still get the same problem?

     

    Regards,

     

    Ken 

  •  09-27-2012, 5:27 PM 74800 in reply to 74798

    Re: Error with images

      <appSettings>
        <add key="webpages:Version" value="2.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="PreserveLoginUrl" value="true" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
          <add key="RichTextEditorTempPath" value="\\path\to\public_html\rtetemp" />
          <add key="RTE.AjaxUploader.TempDirectory" value="~/rtetemp" />
          <add key="RTE.ImageEditor.TempFolder" value="~/rtetemp" />
      </appSettings>

     

    Have tried without them as well, the folder exists.

  •  09-27-2012, 9:06 PM 74802 in reply to 74795

    Re: Error with images

    Dear Aleborg,

     

    Are you using the latest RTE 8.0?

    Can you paste an online testing page? 

     

    Regards,

    Jeff 

  •  09-28-2012, 2:30 AM 74804 in reply to 74802

    Re: Error with images

    Sent you a PM where you can test. If you compare the html of the two pages you'll see that they are identical. Latest RTE is used, downloaded it yesterday.

    The code behind looks like this:

    1. [Authorize(Roles = "Administratör,Redaktör,Resultat redaktör")]  
    2. public ActionResult NewsAdd()  
    3. {  
    4.     Editor Editor1 = new Editor(System.Web.HttpContext.Current, "Editor1");  
    5.     Editor1.LoadFormData("Skriv här...");  
    6.     Editor1.MvcInit();  
    7.     ViewBag.Editor = Editor1.MvcGetString();   
    8.     return View();  
    9. }  
    10.   
    11. [Authorize(Roles = "Administratör,Redaktör,Resultat redaktör")]  
    12. public ActionResult TestAdd()  
    13. {  
    14.     Editor Editor1 = new Editor(System.Web.HttpContext.Current, "Editor1");  
    15.     Editor1.LoadFormData("Skriv här...");  
    16.     Editor1.MvcInit();  
    17.     ViewBag.Editor = Editor1.MvcGetString();   
    18.   
    19.     return View();  
    20. }  
     

     

    Other issues:

    1. The design, this is a problem in Cute Editor for ASP.NET as well. It's sensitive to other CSS in the page. I use Zurb Foundation and if I add the editor to page containing that framework all icons get messed up:

     

    2. TinyMCE does a great job integrating with MVC (in all other ways it sucks :)

    You just add this: [UIHint("tinymce_jquery_full"), System.Web.Mvc.AllowHtml] to the "variable" in your class, like this:

    1. [Required]  
    2. Display(Name = "Message")]  
    3. [UIHint("tinymce_jquery_full"), System.Web.Mvc.AllowHtml]  
    4. public string Message { getset; }  
    and in your view:

    1. @Html.EditorFor(m => m.Message)
    and there you have a wysiwyg editor that works like any textfield, you don't have to do anything additional in the code behind to manage the result:

    1. [HttpPost]  
    2.  public ActionResult Edit(News news)  
    3.  {  
    4.      if (ModelState.IsValid)  
    5.      {  
    6.          db.Entry(news).State = EntityState.Modified;  
    7.          db.SaveChanges();  
    8.          return RedirectToAction("Index");  
    9.      }  
    10.      return View(news);  
    11.  }  
    This is something that I would like to see for Rich Text Editor.

  •  09-28-2012, 2:32 AM 74805 in reply to 74804

    Re: Error with images

    uploaded an image but it doesn't seem to be found; /rte-uploads/members/219082/2012-09-28 09-16-49.png
  •  09-28-2012, 3:37 AM 74806 in reply to 74805

    Re: Error with images

    Dear Anders,

     

    Thanks for your suggestion.

    We will fix this MVC issue as soon as possible.

     

    Please send web.config, NewsAdd,TestAdd views and controllers to my email address [email protected]

     

    Regards,

    Jeff 

  •  12-26-2012, 6:31 PM 75551 in reply to 74795

    Re: Error with images

    Hi Aleborg,

     

    I wonder if you were able to resolve your problem.  I am having the same problems

     

    Burley 

View as RSS news feed in XML