RadUpload and MultiView in Safari 3

Thread is closed for posting
8 posts, 0 answers
  1. Mark DeMichele
    Mark DeMichele avatar
    74 posts
    Member since:
    Oct 2005

    Posted 22 May 2008 Link to this post

    Hi,

    I seem to be having a Safari-specific problem involving a MultiView and RadUpload. If the RadUpload control is present in a View of a MultiView that is not the active View, then Safari does not render the control properly. Upon viewing the WebInspect Console, the following error is obtained:

          Sys.ScriptLoadFailedException: The script 'http://localhost/deltanet/ScriptResource.axd?d=KHlrNZ2Q4IDiiwop_XNJxkQGN1i2x-sO6rt-iO3fB2zZXzp8EjGBcFdHrYUZ61jWPpt9H4Hsf4_3abAyDCQU0A2&t=633438057580000000' failed to load. Check for: Inaccessible path. Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings. Missing call to Sys.Application.notifyScriptLoaded().
    This problem does not occur when:
    - the RadUpload control is not within a View control
    - the active View is defaulted to the View with the RadUpload control in it
    -  using any other browser besides Safari 3

    Any ideas?

    The aspx code and code behind follows. Note that the switching of the Views is triggered by a click of the "Switch to Next View" button.

    using System; 
    using System.Collections; 
    using System.Configuration; 
    using System.Data; 
    using System.Linq; 
    using System.Web; 
    using System.Web.Security; 
    using System.Web.UI; 
    using System.Web.UI.HtmlControls; 
    using System.Web.UI.WebControls; 
    using System.Web.UI.WebControls.WebParts; 
    using System.Xml.Linq; 
     
    public partial class Test_testradupload_safari : System.Web.UI.Page 
     
        protected void TestViewButton_Click(object sender, EventArgs e) 
        { 
            MultiView1.ActiveViewIndex = 1; 
        } 
     



    1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="testradupload-safari.aspx.cs" Inherits="Test_testradupload_safari" %> 
    2 <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    3 <%@ Register Src="testradupload-safari-uc.ascx" TagName="testradupload" TagPrefix="uc1" %> 
    4  
    5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    6  
    7 <html xmlns="http://www.w3.org/1999/xhtml"
    8 <head runat="server"
    9     <title>Untitled Page</title> 
    10 </head> 
    11 <body> 
    12     <form id="form1" runat="server"
    13     <div> 
    14      <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
    15     <asp:UpdatePanel runat="server" ID="UpdatePanelWizard" UpdateMode="Conditional"
    16         <ContentTemplate> 
    17             <asp:Panel runat="server" ID="PanelWizard"
    18                 <asp:MultiView runat="server" ID="MultiView1" ActiveViewIndex="0"
    19                     <asp:View ID="View1" runat="server"
    20                         <table> 
    21                             <tr> 
    22                                 <td> 
    23                                     test view 
    24                                 </td> 
    25                             </tr> 
    26                         </table> 
    27                         <asp:Button ID="TestViewButton" runat="server" Text="Switch to Next View" OnClick="TestViewButton_Click" /> 
    28                     </asp:View> 
    29                     <asp:View ID="View2" runat="server"
    30                          
    31                         <table> 
    32                             <tr> 
    33                                 <td> 
    34                                     <telerik:RadUpload ID="RadUploadControl"  runat="server" Skin="Vista" /> 
    35                                 </td> 
    36                             </tr> 
    37                         </table> 
    38                     </asp:View> 
    39                 </asp:MultiView> 
    40             </asp:Panel> 
    41         </ContentTemplate> 
    42     </asp:UpdatePanel> 
    43     </div> 
    44     </form> 
    45 </body> 
    46 </html> 
    47  

  2. Mark DeMichele
    Mark DeMichele avatar
    74 posts
    Member since:
    Oct 2005

    Posted 22 May 2008 Link to this post

    Somehow the error got cut off. Here it is again:

          Sys.ScriptLoadFailedException: The script 'http://localhost/deltanet/ScriptResource.axd?d=KHlrNZ2Q4IDiiwop_XNJxkQGN1i2x-sO6rt-iO3fB2zZXzp8EjGBcFdHrYUZ61jWPpt9H4Hsf4_3abAyDCQU0A2&t=633438057580000000' failed to load. Check for: Inaccessible path. Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings. Missing call to Sys.Application.notifyScriptLoaded().
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 23 May 2008 Link to this post

    Hi Mark,

    You've encountered a problem we are still researching. For a reason we could not discover yet RadControls made visible after an Ajax call throw the error you mentioned.

    From our research so far we found two workarounds to the problem:
    1. Register ScriptReferences for the scripts the controls use to the ScriptManager, e.g.:
       <asp:ScriptManager ID="ScriptManager1" runat="server">
          <Scripts>
              <asp:ScriptReference Name="Telerik.Web.UI.Common.Core.js" Assembly="Telerik.Web.UI" />
              <asp:ScriptReference Name="Telerik.Web.UI.Upload.RadUpload.js" Assembly="Telerik.Web.UI" />
          </Scripts>
       </asp:ScriptManager>
    2. Use RadScriptManager instead of ScriptManager (valid only for .NET Framework 3.5).
    Our research on the matter continues and I hope we will be able to find a solution soon.

    I hope this helps.
    Kind regards,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Mark DeMichele
    Mark DeMichele avatar
    74 posts
    Member since:
    Oct 2005

    Posted 23 May 2008 Link to this post

    I know it's a long shot (since you folks have probably researched this problem to the tooth and nail), but have you tried the following suggestion posted on your forum? I've seen it posted on the web elsewhere. I haven't tried it personally since we would rather not modify your existing scripts if possible.

    http://www.telerik.com/community/forums/thread/b311D-bdekkm.aspx
  6. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 23 May 2008 Link to this post

    Hi Mark,

    Indeed, the workaround Jeff found is a completely valid one. Actually it is very close to the first workaround I suggested with the difference that real files are used instead. Let me explain:

    The problem you encounter happens because for some reason the after-AJAX-call-registration of the client-side code of the controls fails in Safari.

    This registration is a result of the control being initially invisible and the accompanying <script> tags being output the first time the control becomes visible. Please note, that the src attribute of these <script> tags is valid, e.g. if you make a request to the server using that URL, you will get the proper content.

    When you set <asp:ScriptReference> definitions to the ScriptManager, the ScriptManager control initially outputs the <script> tags, corresponding to the ScriptReferences. This is why there is no need for their registration after the AJAX call (for the same reason the ScriptManager does not even attempt to register them, which removes the condition for the error to happen).

    As per Jeff's workaround - the approach is actually the same (he also registers the ScriptReferences to the ScriptManager). The difference is that he defines a Path attribute to each ScriptReference. When the ScriptManager meets such a ScriptReference, it resolves the specified path and includes a <script> tag, pointing to the physical file. When the physical file approach is used, the notifyScriptLoaded() call is needed to have the client-side code work with Ajax requests (this is done automatically by the ScriptResourceHandler if the non-file approach used).
    In general, in Jeff's workaround the <script> tags get included to the page initially too.

    I want to note something: as a control vendor we always strive to make our products work with minimal configuration and additional steps, which could possibly increase the complexity of a future update. This is the reason we don't suggest manual script registration unless no other way to solve the problem - we really want to help you deliver more than expected.

    I hope this helps.

    Kind regards,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Mark DeMichele
    Mark DeMichele avatar
    74 posts
    Member since:
    Oct 2005

    Posted 23 May 2008 Link to this post

    Hi Erjan,

    That explanation definitely helps. Many of the explanations given across the web were a bit haphazard and don't really show a clear understanding of the problem.

    Thanks,
    Mark
  8. Madu
    Madu avatar
    7 posts
    Member since:
    Jul 2007

    Posted 08 Jul 2008 Link to this post

    hi,
    im having a similar kind of matter. styles are not working properly if the radupload control is in inactive view at the initial load. if it is in active view at initial load it works fine. is there any work around this?

    ragards,
    madu
  9. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 08 Jul 2008 Link to this post

    Hello Madu,

    Try setting the upload's EnableAjaxSkinRendering property to True when you are showing it on the page. For example, if you have a tabstrip+multipage combination, you can use the tabstrip's TabClicked event to set the upload property:

    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e) 
        RadUpload1.EnableAjaxSkinRendering = true

    This will force the upload control to render its styles during the Ajax request.


    Best wishes,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017