简体   繁体   中英

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.

    <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.

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.

---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

erver" Text="Supplier Name" CssClass="itemlabel"

and shows multiple error messages:

  • "; expected" -> the tooltip indicates this based on the System.String
  • The variable 'Name' is declared but never used
  • "; expected" -> a second message from the double-quote after Name to the end of the line

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.

This was a web development lesson for me that the issue may not always be adjacent to where the error message is displayed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM