简体   繁体   English

Resharper无法从母版页检测到ContentPlaceHolder ID?

[英]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. 我是ASP.net和Webform应用程序的新手,并且继承了一些非常糟糕的代码,但是我遇到了一个奇怪的问题,我无法弄清楚或想出如何用Google搜索它。

In my web site, Resharper is complaining on every page that it couldn't find the corresponding ContentPlaceHolderID from the master page. 在我的网站上,Resharper抱怨每个页面都无法从母版页中找到相应的ContentPlaceHolderID。

Here's a stripped down (for security's sake) version of the ASP.net markup: 这是ASP.net标记的简化版本(出于安全考虑):

<%@ 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): 这是_site.master文件(位于网站的根目录):

<%@ 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'. 这是字面意义上的Resharper错误消息:“无法解析符号'ContentPlaceHolder'。

Any ideas? 有任何想法吗? Any way I can have Resharper stop displaying this error message? 有什么办法可以让Resharper停止显示此错误消息? 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. 我只是想让Resharper表现出色。

Yes, it can now. 是的,现在可以了。

Install a newer version of ReSharper ( 6.1 or later) and try it again. 安装较新版本的ReSharper( 6.1或更高版本),然后重试。 I also experienced the same problem with earlier versions of ReSharper - but since the version 6.1, the problem just disappeared. 我也遇到了与ReSharper的早期版本相同的问题-但是从6.1版开始,问题就消失了。

Plz tell if it solved your problem, too. 请告诉它是否也解决了您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 母版页未抓取contentPlaceHolder的样式 - Master Page doesn't grab styling for contentPlaceHolder 访问母版页上的contentplaceholder - Accessing a contentplaceholder on a master page 我可以在Razor Partial View中填充母版页中的ContentPlaceHolder吗? - Can I populate a ContentPlaceHolder in a master page from within a Razor Partial View? 我可以知道母版页的ContentPlaceHolder中的哪个页吗? - Can I know what page is in my master page's ContentPlaceHolder? 我们可以在子母版页中的contentplaceholder中找到div标签 - can we palce div tags inside contentplaceholder in child master page 母版页需要知道当前内容页是否未使用ContentPlaceHolder - Master page needs to know if a ContentPlaceHolder hasn't been used by current content page 使用Web表单在母版页中引导巨型机和contentplaceholder - bootstrap jumbotron and contentplaceholder in Master Page using webforms 使用母版页和ContentPlaceHolder创建字幕 - Creating a sub-title with a Master Page and ContentPlaceHolder 停止使用ContentPlaceHolder滚动到母版页的顶部吗? - Stop scrolling to the top on a master page with ContentPlaceHolder? 母版页中contentplaceholder之外的更新面板导致回发到内容页 - An updatepanel outside of contentplaceholder in master page causes post back to content page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM