Error with the main page

I am creating a new master page using VS2010 Beta 2 and I am getting this warning (which is causing me errors on content pages):

Validation (XHTML 1.0 Transitional): Content is not supported outside of 'script' or 'asp: content'.

Homepage code:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Bob.master.cs" Inherits="TShirtFactory.Web.All.Core.lib.masterpage.Bob" %>

<!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></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

      

As you can see, this is the generated default homepage code. I get a warning when I click the tag at the top. Does anyone have any idea what is going on?

thanks

+2


a source to share


2 answers


It's just ... Visual Studio is bonkers. In fact, the truth is that it cannot validate some of the markup simply because most of it is dynamic. For example, in my project, I am constantly warning about missing <title> because it is added dynamically. Bottom line: The XHTML validator really doesn't know much about ASP.NET code.



-1


a source


In my case, the error went away after removing the masterPageFile attribute from the Page section in the web.config file:

<configuration>
  <system.web>
     <pages styleSheetTheme="mystyle" masterPageFile="~/myMaster.master" />       
  </system.web>
</configuration>

      



Or, if you need this attribute in your web.config file, just add an empty MasterPageFile to the master page:

<%@ Master Language="VB" AutoEventWireup="false" CodeFile="mySecondMaster.master.vb" Inherits="mySecondMaster" MasterPageFile="" %>

      

+6


a source







All Articles