[英]aspx content page no recognizing server reference and tags
In VS 2017, my content page has recently stopped recognizing server references and some basic asp control tags. 在VS 2017中,我的内容页面最近停止识别服务器引用和一些基本的ASP控制标签。
<script src='<%= ResolveClientUrl("~/layout/ariaGridCombobox.js") %>' type="text/javascript"></script>
... ...
The ResolveClientUrl is indicating an error message "The name 'ResolveClientUrl' does not exist in the current context' I have six script lines in a row that do the same thing. Oddly, the error goes away when removing the sixth entry. This was working just fine a few days ago with all six references. ResolveClientUrl指示错误消息“当前上下文中不存在名称'ResolveClientUrl',我连续有六行脚本执行相同的操作。奇怪的是,删除第六条条目时错误消失了。就在几天前,所有六个参考文献都很好。
With the above error, the closing tag for the asp:Label displays an error message of "'Label' is a type, which is not valid in the given context" When hovering over the tag, the tool tip shows a reference to the System.Web.UI.WebControls.Label. 出现上述错误时,asp:Label的关闭标签显示错误消息“'Label'是类型,在给定的上下文中无效”。将鼠标悬停在标签上时,工具提示将显示对系统的引用.Web.UI.WebControls.Label。
---For testing purposes, I removed the sixth script reference which then displays an underline on the asp:Label line for the portion of the line that reads ---出于测试目的,我删除了第六个脚本参考,该参考随后在asp:Label行上为读取该行的部分显示一个下划线
erver" Text="Supplier Name" CssClass="itemlabel"
and shows multiple error messages: 并显示多个错误消息:
I am at a loss for what is causing this behavior. 我对造成这种行为的原因不知所措。 Any input is greatly appreciated.
任何输入,不胜感激。
Thanks 谢谢
Further down the main page was: 在主页的最下方是:
<div id="divAttachments" runat="server">
<!--#include file="~/pages/AttachmentFilesGrid.aspx"-->
</div>
Code in the attachment file grid was: 附件文件网格中的代码为:
<%--<asp:updatepanel runat="server" id="updAttachments" updatemode="Conditional">--%>
<ContentTemplate>
...
</ContentTemplate>
<%--</asp:updatepanel>--%>
The issue on the main page resulted from the ContentTemplate not being commented out. 主页上的问题是由于ContentTemplate没有被注释掉而导致的。
This was a web development lesson for me that the issue may not always be adjacent to where the error message is displayed. 对我来说,这是一个Web开发课程,该问题可能并不总是与错误消息的显示位置相邻。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.