'Respond'不是有效的脚本名称,名称必须以.js结尾-Microsoft教程

问题描述 投票:1回答:1
Server Error in '/' Application.

'respond' is not a valid script name. The name must end in '.js'.

Description: An unhandled exception occurred during the execution of the 
current web request. Please review the stack trace for more information 
about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: 'respond' is not a 
valid script name. The name must end in '.js'.

Source Error:

An unhandled exception was generated during the execution of the current web 
request. Information regarding the origin and location of the exception can 
be identified using the exception stack trace below.

[InvalidOperationException: 'respond' is not a valid script name. The name 
must end in '.js'.]
System.Web.UI.ScriptReference.GetDebugName(String releaseName) +139
System.Web.UI.ScriptReference.ShouldUseDebugScript(String releaseName, 
Assembly assembly, Boolean isDebuggingEnabled, Assembly currentAjaxAssembly) +31
System.Web.UI.ScriptReference.DetermineResourceNameAndAssembly(ScriptManager scriptManager, Boolean isDebuggingEnabled, String& resourceName, Assembly& assembly) +98
System.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip, Boolean useCdnPath) +104
System.Web.UI.ScriptReference.GetUrlInternal(ScriptManager scriptManager, Boolean zip, Boolean useCdnPath) +603
System.Web.UI.ScriptReference.GetUrl(ScriptManager scriptManager, Boolean zip) +182
System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1 uniqueScripts) +204
System.Web.UI.ScriptManager.RegisterScripts() +465
System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +124
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +9883750
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1069

我不知道是什么导致了此错误,我已经在许多网站上进行了搜索,而我根本找不到导致该错误的原因或原因。我正在Microsoft网站上关注本教程[Link]我已经做了所有的事情,直到要求您下载主题并添加到项目中。我已经做到了,当它说要运行代码时,就会出现此错误。在过去的两天里,我和我的朋友一直被这个错误困扰,我们无法解决。

javascript html visual-studio visual-studio-2010 visual-studio-2017
1个回答
0
投票

这很好地解决了以后出现的一个更大的问题,但是我能够通过注释Site.Master的〜27行来解决这个错误。

<%--<asp:ScriptReference Name="respond" />--%>

我不知道在以后的(old) tutorial中是否需要“响应”的事情。希望不是。另外FWIW,在此之前,我确实更新了我的所有nuget软件包-似乎都不会影响“响应”错误。

© www.soinside.com 2019 - 2024. All rights reserved.