[CLOSED] The function "addScript" causing the error "Syntax Error"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] The function "addScript" causing the error "Syntax Error"

    Hello,

    I'm migrating my application from the Ext version 2.5.3 to version 3.0.0 and I have the following problem. The surface of the application contains a various control elements of Ext, eg Panels, Trees etc.. Depending on the choice of the user is generated via an Ajax call additional controls over Javascript-Code. The javascript code is passed via the method "addScript" of the ResourceManager to the client. Then the message appears in the IE browser:

    JavaScript critical error in (unknown source location)

    SCRIPT1002: Syntax error

    The added script code has no error. With Fiddler, I noticed that he supplied script code is embedded in the method "Ext.onReady". But it contains additionally the two strings "<#: anchor id =" ExtNetOnReadyBegin">" and <#: anchor id = "ExtNetOnReadyEnd"> " that causes the error.


    abstract from Fiddler

    scriptStartupBlock|ScriptContentWithTags|{"text":" Ext.onReady(function(){\u003c#:anchor id=\"ExtNetOnReadyBegin\" /\u003eExt.net.DirectEvent.showFailure = Ext.emptyFn;Ext.ns(\"Ext.net.DirectMethods\");

    --additional scriptcode

    \u003c#:anchor id=\"ExtNetOnReadyEnd\" /\u003e});","type":"text/javascript"}|
    With the Ext version 2.5.3, this error does not occur. Can somebody help me, to solve this problem.


    Uwe
    Last edited by Daniil; Sep 26, 2015 at 8:41 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Do you use UpdatePanel? Can you provide test case?
  3. #3
    Hello all,

    I have come across the exact same problem with version 3.2.1

    It is on a WebForms page containing Report Viewer / Update Panel / Script Manager embedded within Viewport / Panel / Content.

    I have tried removing the Update Panel but the error still persists.

    sample code

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
      
    
     
     <style>
     div#RptViewer1_ctl09
    {
        overflow: visible !important;
    }
     </style>
    
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Default" DisableViewState="false" ScriptMode="Debug" />
        <asp:ScriptManager ID="sm1" runat="server" EnableScriptGlobalization="true" />
    
            <ext:Panel ID="pnl_main" runat="server" Frame="true" Layout="VBoxLayout" TitleAlign="Center" Icon="Report">
              <LayoutConfig>
                <ext:VBoxLayoutConfig Align="Center" />
              </LayoutConfig>
              <Items>
                <ext:Panel ID="pnl_param" runat="server" Layout="FitLayout" Height="300" AutoScroll="true" Hidden="true">
                </ext:Panel>
                <ext:Panel ID="pnl_rpt" runat="server" AutoScroll="true" Flex="1">
                  <Content>
    
                  </Content>
    
                </ext:Panel>
              </Items>
            </ext:Panel> 
    
                        <asp:UpdatePanel runat="server">
    	                <ContentTemplate
    				                <rsweb:ReportViewer runat="server" ID="RptViewer1" Font-Names="Verdana" 
    					                Width="100%" Height="100%" ShowPrintButton="false" 
    					                Font-Size="8pt" InteractiveDeviceInfos="(Collection)" ProcessingMode="Remote" 
    					                WaitMessageFont-Names="Verdana" WaitMessageFont-Size="12pt" >
    					                <ServerReport ReportPath="/Reports/test" 
    						                ReportServerUrl="http://127.0.0.1/ReportServer" />
    
                               
    				                </rsweb:ReportViewer>
    	                </ContentTemplate>
                    </asp:UpdatePanel>
    
    
        </form>
    </body>
    </html>
    Generated Error :

    Click image for larger version. 

Name:	SyntaxError_1002.png 
Views:	116 
Size:	21.3 KB 
ID:	24241

    There must be a way to instruct Ext.Net not to insert these anchor tags in the dynamic javascript that is generated.
    (hint: ResourceManager.cs #1387)

    Regards,
    AnFil
    Last edited by AnFil; Sep 21, 2015 at 10:04 PM. Reason: added screenshot
  4. #4
    Hi @AnFil,

    Welcome to the Ext.NET forums!

    Please clarify is the problem only reproducible with a <rsweb:ReportViewer> on the page? If yes, could, please, guide me how to introduce that component into my test project?
  5. #5
    Hello Danil,

    thank you for your prompt reply.

    Please find below a basic web.config to use with sample code above.

    I am using MS VS 2012 Premium Edition. I think that the ReportViewer Server control is installed along with VS2012 so it should reside in the GAC.
    I have also MS SQL Server 2012 installed but i dont thin that this is required.
    The Reportserver is the standard ASP.NET control used for displayin SQL Server Reporting Services Reports.
    You can start a new ASP.NET Report Project from VS and it will automatically configure a simple page with a Report Viewer plus a web.config with the required references.

    <?xml version="1.0" encoding="utf-8"?>
    
    <configuration>
    
      <configSections>
        <section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false" />
      </configSections>
    
      <system.web>
        <compilation targetFramework="4.5">
          <assemblies>
            <add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          </assemblies>
        </compilation>
    
      
    
        <!-- This httpHandlers config only required if using IIS6 (or lower) -->
        <!--
        <httpHandlers>
          <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" />
        </httpHandlers>
        -->
        <!-- This httpModules config only required if using IIS6 (or lower) -->
        <!--
        <httpModules>
          <add name="DirectRequestModule" type="Ext.Net.DirectRequestModule, Ext.Net" />
        </httpModules>
        -->
        <pages>
          <controls>
            <add assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" />
          </controls>
          <namespaces>
            <add namespace="Ext.Net" />
      
          </namespaces>
        </pages>
      </system.web>
    
      <extnet theme="Default" licenseKey="*********************" initScriptMode="Linked" />
    
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
    
        <modules>
          <add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule, Ext.Net" />
        </modules>
    
        <handlers>
          <add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" />
         <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </handlers>
      </system.webServer>
    
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
            <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Ext.Net.Utilities" publicKeyToken="2c34ac34702a3c23" />
            <bindingRedirect oldVersion="0.0.0.0-2.5.0" newVersion="2.5.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Transformer.NET" publicKeyToken="e274d618e7c603a7" />
            <bindingRedirect oldVersion="0.0.0.0-2.1.1" newVersion="2.1.1" />
          </dependentAssembly>
    
        </assemblyBinding>
      </runtime>
    
    </configuration>

    I hope this helps,
    Regards,
    AnFil
  6. #6
    You can start a new ASP.NET Report Project from VS
    Could you, please, clarify where it is the New Project wizard? I don't see. I created a project from the "Reporting" menu item, but it doesn't look to be the case.

Similar Threads

  1. Replies: 6
    Last Post: May 31, 2013, 3:04 AM
  2. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  3. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  4. Replies: 4
    Last Post: Aug 24, 2011, 11:29 AM
  5. Replies: 8
    Last Post: May 30, 2011, 5:55 PM

Tags for this Thread

Posting Permissions