gpt4 book ai didi

asp.net - angular 4部署到asp.net网站给出错误

转载 作者:太空狗 更新时间:2023-10-29 17:46:22 24 4
gpt4 key购买 nike

我已成功构建我的 Angular 组件并将其部署到 asp.net 网站中。但问题是,如果我将我的代码粘贴到 body 标签下,它就可以正常工作。但是,如果我在一个表单中粘贴,它就不起作用。

所以这在 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>

但是如果我将此代码复制到另一个使用此母版页的网页,它就不起作用,我会在控制台中看到以下日志。

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)

最佳答案

终于找到问题了。它以某种方式与 Ajax ScriptManager 有关。我已经在 ScriptManager 标签中设置了 ScriptMode="Release",现在它工作正常。

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

关于asp.net - angular 4部署到asp.net网站给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45109640/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com