简体   繁体   中英

Resharper can't detect ContentPlaceHolder ID from master page?

I'm very new to ASP.net and webform applications, and I'm inheriting some pretty bad code, but I've got a strange problem that I can't figure out or figure out how to google about it.

In my web site, Resharper is complaining on every page that it couldn't find the corresponding ContentPlaceHolderID from the master page.

Here's a stripped down (for security's sake) version of the ASP.net markup:

<%@ page language="VB" masterpagefile="~/_site.master" autoeventwireup="false" inherits="MyWebPage" theme="Base" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
  <h1>SomeText</h1>
  <br />
</asp:Content>

And here's the _site.master file (located at the root of the web site):

<%@ master language="VB" inherits="_CompanyName" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head runat="server">
    <title>SomeTitle</title>    
  </head>
  <body>
    <form id="form1" runat="server">
      ....form stuff
    </form>
    <asp:ContentPlaceHolder runat="server" ID="ContentPlaceHolder"></asp:ContentPlaceHolder>
  </body>
</html>

Almost every page displays this error. Here's the literal Resharper error message: "Cannot resolve symbol 'ContentPlaceHolder'.

Any ideas? Any way I can have Resharper stop displaying this error message? It doesn't effect the actual rendering of the page at all (as far as I know), because the page displays correctly according to the original makers. I'm just trying to get Resharper to play nicely.

Yes, it can now.

Install a newer version of ReSharper ( 6.1 or later) and try it again. I also experienced the same problem with earlier versions of ReSharper - but since the version 6.1, the problem just disappeared.

Plz tell if it solved your problem, too.

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