I have succesfully built and deployed my angular component into asp.net website. But the problem is if I paste my code under body tag it works fine. But if I paste inside a 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 into another webpage which using this master page, it doesn't work and I see following logs in 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)
Finally I found the issue. Somehow it was related with Ajax ScriptManager. I have set ScriptMode="Release" in ScriptManager tag now it is working fine.
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" ScriptMode="Release">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With