Angular 4 deploy to asp.net site with error

I have successfully created and deployed my angular component on asp.net website. But the problem is, if I paste my code under the body tag, it works fine. But if I paste inside the form it doesn't work.

So this works fine in main.master:

<body>
  <app-root>testtt</app-root>
  <script type="text/javascript" src="/scripts/inline.bundle.js"></script>
  <script type="text/javascript" src="/scripts/polyfills.bundle.js"></script>
  <script type="text/javascript" src="/styles.bundle.js"></script>
  <script type="text/javascript" src="/scripts/vendor.bundle.js"></script>
  <script type="text/javascript" src="/scripts/main.bundle.js"></script>

      

But if I copy this code to another web page using this master page, it doesn't work and I see the following logs in the console.

Uncaught Error: Sys.ParameterCountException: Parameter count mismatch.
    at Function.Error$create [as create] (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:237)
    at Function.Error$parameterCount [as parameterCount] (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:413)
    at Function$_validateParameterCount [as _validateParameterCount] (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:118)
    at Function$_validateParams [as _validateParams] (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:70)
    at String$startsWith (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:491)
    at String.startsWith (polyfills.bundle.js:5199)
    at new Sys$UI$DomEvent (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:3986)
    at browserHandler (ScriptResource.axd?d=3YJmGXxjI2IKNjUZL30bBbVBGOzpviJQaJ0A9mxA_CXR8fTNHpjVjDF4vyz3OkxXRfN4mDos_e1vdt…:4052)

      

+3


source to share


1 answer


Finally I found the problem. It had something to do with the Ajax ScriptManager somehow. I set ScriptMode = "Release" on the ScriptManager tag, now it works fine.



<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" ScriptMode="Release">

      

+5


source







All Articles