Are pages getting cached?

2 posts, 0 answers
  1. Happy
    Happy avatar
    63 posts
    Member since:
    Aug 2008

    Posted 12 May 2010 Link to this post

    I've made a Silverlight HtmlEditor control that inherits from RadHtmlPlaceHolder. This loads an editor.aspx page that uses the ajax RadEditor. When that page loads, it makes a call back to the siliverlight host HtmlEditor control to get the html to edit. When I save from my silverlight app, the HtmlEditor control makes a call to that page to get updated html.

    I was using the following code to get the html FROM the page

    HtmlElement iframe = (HtmlElement)this.HtmlPresenter.Children[0];  
    // Set an ID to the IFrame so that can be used later when calling the javascript   
    iframe.SetAttribute("id", "myIFrame");  
    string code = "document.getElementById('myIFrame').contentWindow.GetEditor().get_html();";      
    string html = (string)HtmlPage.Window.Eval(code); 

    However, I was having an odd issue. The first time I editted some content, it would work. Then after, every other time I tried to edit content, while the correct content would appear in the editor, the changes actually saved (that is the html returned from the page) was always the same text as the very first time I had editted.

    I made a change to the above code to always uniquely name the frame

    string guid=Guid.NewGuid().ToString().Replace("-","");  
    HtmlElement iframe = (HtmlElement)this.HtmlPresenter.Children[0];  
    // Set an ID to the IFrame so that can be used later when calling the javascript   
    iframe.SetAttribute("id", guid);  
    string code = "document.getElementById('"+guid+"').contentWindow.GetEditor().get_html();";  
    string html = (string)HtmlPage.Window.Eval(code);  
     

    and now I'm always getting back the correct updated hml.

    This makes it seem like everytime I open a new window with a RadHtmlPlaceHolder control, that even after I close that window, that something is getting cached or not cleaned up.

    Any ideas?
  2. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 17 May 2010 Link to this post

    Hi Happy,

    As i understand, you put a HtmlPlaceHolders in RadWindow? In that case you're right that we didn't clean-up the Html after you close the Window so the frames remains there. We've logged that bug and should be fixed soon. Till then hope your workaround will work fine.
    Sorry for any inconvenience.

    All the best,
    Miro Miroslavov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
Back to Top