我正在 Visual Studios 2013 中使用 JavaScript 语言制作一个猜数字游戏。我只是想知道如何使用此代码 <asp:ScriptReferenceName="guess-number.js"Assembly="System.Web"Path="~/Games/guess-number/guess-number.js" />
在我的页面中。我正在使用 ASP。
唯一的问题是它给了我一个错误:
Element 'ScriptReferenceName' is not a known element. This can occur if there is a compilation error in the website, or the web.config file is missing.
有什么我错过的吗?
最佳答案
有一个名为 ScriptReference
的元素而不是ScriptReferenceName
。名称是此元素的一个属性,包含该元素时不带空格,从而导致了此特定错误。
<Sripts>
<asp:ScriptReference Name="guess-something.js" />
</Scripts>
这应该是 <asp:ScriptManager
的一部分父标签
关于javascript - 脚本引用名称错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31576040/