Skip to content

Infragistics Community Forum / Cross Platform / Ultimate UI for Xamarin / Sys.ScriptLoadFailedException Inaccessible Path

Sys.ScriptLoadFailedException Inaccessible Path

New Discussion
Jaimir Guerrero
Jaimir Guerrero asked on Sep 12, 2011 10:16 PM

Hi

We have a problem when inserting some ultrawebeditor into an UpdatePanel, and we tried to hide/show it throw AJAX server side event.

Example:

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">

            <ContentTemplate>

                <asp:Panel ID="Panel1" runat="server" Visible="False">

                    <igtxt:WebPercentEdit ID="WebPercentEdit1" runat="server">

                    </igtxt:WebPercentEdit>

                </asp:Panel>

                <asp:Label ID="Label1" runat="server" Text="This is a label!"></asp:Label>

                <asp:Button ID="Button1" runat="server" Text="Click Me" OnClick="Button1_Click" />

            </ContentTemplate>

        </asp:UpdatePanel>

C# code:

protected void Button1_Click(object sender, EventArgs e)

        {

            Label1.Text = "hi" + DateTime.Now.ToString();

            this.Panel1.Visible = true;

        }

At this point client side generate the exception:

Error: Sys.ScriptLoadFailedException: The script ‘if_res/js/ig_shared.js'…

If "Panel1" is visible = true, this behavior does not occurred.

Thank's

Jaimir G.

Sign In to post a reply

Replies

  • 0
    [Infragistics] Viktor Snezhko
    [Infragistics] Viktor Snezhko answered on Feb 19, 2009 9:16 PM

    Hi Jaimir,

    I tested those codes with a page located in FileSystem website and it worked without problems. I tested various latest and old versions of CLR2.0 and CLR3.5 dlls in VisualStudio 2005 and 2008. The only problem with javascript which I found were in versions built before 7.1. If that is what you use, then I suggest you to update NetAdvantage with newer version. If you have recent version, then probably configuration of my test project was different from yours. I suggest you to submit a bug report with a sample project: http://www.infragistics.com/support/ask-for-help.aspx

    • 0
      Jaimir Guerrero
      Jaimir Guerrero answered on Feb 20, 2009 2:15 PM

      Hi Viktor,

      An important thing is that I defined the javascript path in the web.config file:  <infragistics.web imageDirectory="~/ig_res/" javaScriptDirectory="~/ig_res/js" styleSetName="Default" styleSetPath="~/ig_res"/>

       

      My environment is:

      Operating System Windows Vista Ultimate + sp1 32
      Visual Studio. Microsoft Visual Studio 2008 Version 9.0.30729.1 SPMicrosoft .NET Framework Version 3.5 SP1Installed Edition: EnterpriseMicrosoft Silverlight Projects 2008 Version 9.0.30729.146Microsoft Visual Basic 2008Microsoft Visual C# 2008   Microsoft Visual Studio 2008 Tools for Office   Microsoft Visual Studio Team System 2008 Architecture Edition   Microsoft Visual Studio Team System 2008 Database Edition GDR Version 9.1.31024.02Microsoft Visual Studio Team System 2008 Development EditionMicrosoft Visual Studio Team System 2008 Test Edition   Microsoft Visual Studio Tools for Applications 2.0Microsoft Visual Web Developer 2008Crystal Reports Basic for Visual Studio 2008Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU (KB945282)   KB945282Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU (KB946040)   KB946040Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU (KB946308)   KB946308Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU (KB946344)   KB946344This hotfix is for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU.Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU (KB946581)   KB946581Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU (KB947173)   KB947173Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU (KB947540)   KB947540Hotfix for Microsoft Visual Studio 2008 Shell (integrated mode) – ENU (KB947789)   KB947789Hotfix for Microsoft Visual Studio Team System 2008 Team Suite – ENU (KB944899)   KB944899Hotfix for Microsoft Visual Studio Team System 2008 Team Suite – ENU (KB946673)   KB946673Hotfix for Microsoft Visual Studio Team System 2008 Team Suite – ENU (KB947171)   KB947171Hotfix for Microsoft Visual Studio Team System 2008 Team Suite – ENU (KB947180)   KB947180Hotfix for Microsoft Visual Studio Team System 2008 Team Suite – ENU (KB948127)   KB948127Hotfix for Microsoft Visual Studio Team System 2008 Team Suite – ENU (KB953256)   KB953256Microsoft Visual Studio Team System 2008 Team Suite – ENU Service Pack 1 (KB945140)   KB945140Oracle Developer Tools for Visual Studio   11.1.0.6.20PowerCommands for Visual Studio 2008   1.0Microsoft SQL Server Analysis Services Designer Version 10.0.1600.22Microsoft SQL Server Integration Services Designer Version 10.0.1600.22 ((SQL_PreRelease).080709-1414 )Microsoft SQL Server Reporting Services Designers Version 10.0.1600.22Update for Microsoft Visual Studio Team System 2008 Team Suite – ENU (KB956453)   KB956453Visual Studio Package Load Analyzer   1.0VLinq query editor   1.0GhostDoc for Visual Studio 2008.
      Project Info Visual c#, ASP.NET Web Application for .Net FrameWork 3.5
      Infragistics NetAdvantage for .NET 2008 Vol. 3 CLR 3.5

       

      I will submit a bug report.

      Thanks.Jaimir G.

      • 0
        [Infragistics] Viktor Snezhko
        [Infragistics] Viktor Snezhko answered on Feb 20, 2009 6:14 PM

        Hi Jaimir,

        Now I understand what happens. There is no need to submit a bug report to Infragistics.

        The Infragistics controls in order to enable their client script under ScriptManager (AJAX) use the
        System.Web.UI.ScriptManager.RegisterClientScriptInclude
        method. But if script is not embedded in dll and it was not registered on full postback, then ScriptManager has issues with processing that new resource. You can verify that by following:

        1. Create a simple "test.js" file which contains something like alert('test.js') or leave it blank, it does not matter what it has.
        2. Remove percent editor from your test page and keep only panels and button.
        3. Process OnPreRender event of Page and register that file conditionally (when UpdatePanel gets visible).
        4. Run page, click a button which shows UpdatePanel and get the same exception as with percent editor (or any other control which uses local js resources).

        Below is cs codes:

        protected override void OnPreRender(EventArgs e)
        {
         
        if(this.UpdatePanel1.Visible)
             System.Web.UI.
        ScriptManager.RegisterClientScriptInclude(this.UpdatePanel1, this.UpdatePanel1.GetType(), "myKey", "test.js");
         
        base.OnPreRender(e);
        }

        If the only Infragistics controls used by your applications is that editor in initially hidden UpdatePanel, then you may try to get around that by explicit registration of js files used by editor. If your application uses controls created on initial load or full postback, then similar approach can bring problems, because it will lead to double instances of same js files (worst case with ig_shared.js). Example to fix that specific page with editor located in UpdatePanel1:

        protected override void OnPreRender(EventArgs e)
        {
         
        if(!this.UpdatePanel1.Visible)
          {
             System.Web.UI.
        ScriptManager.RegisterClientScriptInclude(this.UpdatePanel1, this.UpdatePanel1.GetType(), "sharedKey", "ig_res/js/ig_shared.js");
             System.Web.UI.
        ScriptManager.RegisterClientScriptInclude(this.UpdatePanel1, this.UpdatePanel1.GetType(), "editKey", "ig_res/js/ig_edit.js");
          }
         
        base.OnPreRender(e);
        }

         

      • 0
        Jeffrey
        Jeffrey answered on Sep 12, 2011 7:21 PM

        I am having this issue today and what I would like to do is be able to get to the Infragistics path that is in the web.config file.

        <infragistics.web imageDirectory="~/Infragistics/Images/" javaScriptDirectory="~/Infragistics/20111CLR35/Scripts/" />

        Is there an infragistics method available to get to the javaScriptDirectory?  I want to code the fix you have using the RegisterScriptInclude but I don't want to hard code the path to the scripts directory.

        Somethine like: RegisterClientScriptInclude(this, this, "sharedKey", Infragistics.JScriptDir + "ig_tree.js")…..etc

        Thanks!

        jeff

      • 0
        [Infragistics] Viktor Snezhko
        [Infragistics] Viktor Snezhko answered on Sep 12, 2011 10:16 PM

        Hi Jeff,

        Infragistics controls should render their scripts from embedded resources without any custom settings in application.
        If application wants to have explicit local js files, then it has 2 options.
        Note: that is supported only by Infragistics.WebUI, but not by Ifragistics.Web.UI.

        1. Use javascriptdirectory in webconfig.

        2. Set JavaScriptXxx properties for each control used by page/application. That can be done within aspx or within codes behind. However, application should ensure that location of ig_shared.js is exactly the same for all controls which depend on it. Example, for tree:

        protected void Page_Load(object sender, EventArgs e)
        {
          this.UltraWebTree1.JavaScriptFilename = Infragistics.JScriptDir + "ig_tree.js";
          this.UltraWebTree1.JavaScriptFileNameCommon = Infragistics.JScriptDir + "ig_shared.js";
        }

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Jaimir Guerrero
Favorites
0
Replies
5
Created On
Sep 12, 2011
Last Post
14 years, 12 months ago

Suggested Discussions

Tags

Created by

Created on

Sep 12, 2011 10:16 PM

Last activity on

Sep 12, 2011 10:16 PM