This is a migrated thread and some comments may be shown as answers.

RadUpload and MultiView in Safari 3

7 Answers 166 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Mark DeMichele
Top achievements
Rank 1
Mark DeMichele asked on 22 May 2008, 09:51 PM
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; 
    } 
 



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="testradupload-safari.aspx.cs" Inherits="Test_testradupload_safari" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Src="testradupload-safari-uc.ascx" TagName="testradupload" TagPrefix="uc1" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
     <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
    <asp:UpdatePanel runat="server" ID="UpdatePanelWizard" UpdateMode="Conditional"
        <ContentTemplate> 
            <asp:Panel runat="server" ID="PanelWizard"
                <asp:MultiView runat="server" ID="MultiView1" ActiveViewIndex="0"
                    <asp:View ID="View1" runat="server"
                        <table> 
                            <tr> 
                                <td> 
                                    test view 
                                </td> 
                            </tr> 
                        </table> 
                        <asp:Button ID="TestViewButton" runat="server" Text="Switch to Next View" OnClick="TestViewButton_Click" /> 
                    </asp:View> 
                    <asp:View ID="View2" runat="server"
                         
                        <table> 
                            <tr> 
                                <td> 
                                    <telerik:RadUpload ID="RadUploadControl"  runat="server" Skin="Vista" /> 
                                </td> 
                            </tr> 
                        </table> 
                    </asp:View> 
                </asp:MultiView> 
            </asp:Panel> 
        </ContentTemplate> 
    </asp:UpdatePanel> 
    </div> 
    </form> 
</body> 
</html> 
 

7 Answers, 1 is accepted

Sort by
0
Mark DeMichele
Top achievements
Rank 1
answered on 22 May 2008, 09:53 PM
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().
0
Erjan Gavalji
Telerik team
answered on 23 May 2008, 12:08 PM
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
0
Mark DeMichele
Top achievements
Rank 1
answered on 23 May 2008, 02:50 PM
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
0
Erjan Gavalji
Telerik team
answered on 23 May 2008, 03:37 PM
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
0
Mark DeMichele
Top achievements
Rank 1
answered on 23 May 2008, 03:55 PM
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
0
Madu
Top achievements
Rank 1
answered on 08 Jul 2008, 08:01 AM
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
0
Lini
Telerik team
answered on 08 Jul 2008, 12:48 PM
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
Tags
Upload (Obsolete)
Asked by
Mark DeMichele
Top achievements
Rank 1
Answers by
Mark DeMichele
Top achievements
Rank 1
Erjan Gavalji
Telerik team
Madu
Top achievements
Rank 1
Lini
Telerik team
Share this question
or