Editor Unusable under certain circumstances in Safari

Last post 09-03-2009, 7:23 AM by bczengel. 3 replies.
Sort Posts: Previous Next
  •  09-01-2009, 4:55 PM 55265

    Editor Unusable under certain circumstances in Safari

    I have created an example.  Please go to http://kratos-dev.perfpathways.com/CuteEditorTest.aspx using Safari 4.0 (PC or Mac).  Then click the button that says "ShowEditor".  The page loads fine the first time but if you reload/refresh the page and click the button again the WYSIWYG doesn't have any contents and you cannot click into it.  I've narrowed it down to Editors contained in templated controls being made visible via a partial page update (asp:UpdatePanel, in the example, the inner UpdatePanel is only used because its the simplest control with a template field.).  I have a custom templated control that has the same problem.  I have no problem implementing a fix in that control instead of waiting for a new release of CuteEditor but I need help as to which javascript to run etc. I've tried reloading the src of the iframe for the WYSIWYG.  This appears to fix the problem but then the contents of the WYSIWYG don't get reported back to the server upon postback.  Also, non of this happens in any other browser.  This seems like a minor problem but in our project if we can't get this fixed quick I will have to do a lot of coding to get around it and go-live is just around the corner.
     
    Here is my code:
     
    1. <%@ Page Language="VB" %>  
    2.   
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    4.   
    5. <script runat="server">  
    6.     Protected Sub btnShowEditor_Click(ByVal sender As ObjectByVal e As System.EventArgs)  
    7.         upInner.Visible = True  
    8.         upOuter.Update()  
    9.     End Sub  
    10. </script>  
    11.   
    12. <html xmlns="http://www.w3.org/1999/xhtml" >  
    13. <head runat="server">  
    14.     <title>Cute Editor Test</title>  
    15. </head>  
    16. <body>  
    17.     <form id="form1" runat="server">  
    18.     <div>  
    19.         <asp:ScriptManager ID="ScriptManager1" runat="server">  
    20.         </asp:ScriptManager>  
    21.         <asp:UpdatePanel ID="upOuter" runat="server"  
    22.             UpdateMode="Conditional">  
    23.             <ContentTemplate>  
    24.                 <asp:UpdatePanel ID="upInner" runat="server" Visible="False">  
    25.                     <ContentTemplate>  
    26.                         <CE:Editor ID="Editor1" runat="server" Text="testme" Visible="True">  
    27.                         </CE:Editor>  
    28.                     </ContentTemplate>  
    29.                 </asp:UpdatePanel>  
    30.                 <asp:Button ID="btnShowEditor" runat="server" OnClick="btnShowEditor_Click" Text="ShowEditor" />  
    31.             </ContentTemplate>  
    32.         </asp:UpdatePanel>  
    33.     </div>  
    34.     </form>  
    35. </body>  
    36. </html> 
     
    Thanks in advance for your help,
    bczengel
  •  09-02-2009, 4:51 AM 55288 in reply to 55265

    Re: Editor Unusable under certain circumstances in Safari

    bczengel,
     
    Please check this example:
     
    Code:
     
    1. <%@ Page Language="C#"%>  
    2. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    3. <html>  
    4.     <head>  
    5.         <script language="javascript">  
    6.         function hide()   
    7.         {   
    8.             document.getElementById("div1").style.display="none";   
    9.         }   
    10.         function show()   
    11.         {   
    12.             document.getElementById("div1").style.display="block";   
    13.         }   
    14.         </script>  
    15.     </head>  
    16.     <body>  
    17.         <form runat="server">  
    18.             <div id="div1">  
    19.                 <CE:Editor id="Editor1" runat="server" EnableStripScriptTags="false"></CE:Editor>  
    20.             </div>  
    21.             <hr>  
    22.             <a onclick="hide()" href="#">Hide</a> |    
    23.             <a onclick="show()" href="#">Show</a>  
    24.             <div id="div2"></div>  
    25.         </form>  
    26.     </body>  
    27.        
    28.     <script>  
    29.         hide();   
    30.     </script>  
    31. </html>  

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  09-02-2009, 8:36 AM 55293 in reply to 55288

    Re: Editor Unusable under certain circumstances in Safari

    Adam,
       Divs are not templated controls and this example does not use ajax what so ever.  This is completely different then my example.  I made my example simple so it could be easily tested.  In actuality the inner UpdatePanel is a stand in for a custom fake popup control that I wrote that produces the same result.  The circumstances of my error have to be as I described them or I will have to change ever place in our application that uses this control and there are many.  I tried doing something like this at the end of the page:
     
    1. <script type="text/javascript">  
    2.         var iframes = document.getElementsByTagName('iframe');  
    3.         for(i=0; i<iframes.length; i++) {  
    4.               iframes[i].src = iframes[i].src;  
    5.         }  
    6. </script> 
     I ran this script if the clients browser was Safari.  This seems to load the content and make the Editor editable again but then on postback any changes to the data are not returned to the server.  In other words only the original content is returned to the server.  I also noticed there is a 1x1.gif image with an onload event attached.  I tried running that script as well but it had the same result.   It seems to me that Safari is caching something.  Why else would it load the first time but not the second time?  I wonder if there is a way to stop that from happening making anything like this script unneeded.
     
    Thanks again for your time,
    bczengel
     
  •  09-03-2009, 7:23 AM 55346 in reply to 55288

    Re: Editor Unusable under certain circumstances in Safari

    Adam,
          I was wondering if this item is still being looked at.
     
    Thank you
    bczengel
View as RSS news feed in XML