2012-03-12 20 views
0

私のマスターページを作成したときに、このエラーが表示されます。ページには、withaspコンテンツプレースホルダに対応しない1つ以上のaspコンテンツがあります。 マスターページで何が問題になっていますか?マスターページの私のコードはここにあります。ありがとうございました。間違って何マスターページ複数のコンテンツがあります

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" 
Inherits="MasterPage" %> 

<!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>Master</title> 
<asp:ContentPlaceHolder id="head" runat="server"> 
</asp:ContentPlaceHolder> 
<style type="text/css"> 
    .style1 
    { 
     height: 63px; 
    } 
    .style3 
    { 
     height: 101px; 
     font-size: xx-large; 
     font-weight: 700; 
     font-family: Tahoma; 
     text-align: center; 
     color: #FFFFFF; 
    } 
    .style6 
    { 
     width: 146px; 
     height: 592px; 
    } 
    .style7 
    { 
     width: 897px; 
     height: 592px; 
    } 
    .style8 
    { 
     height: 592px; 
    } 
    .style9 
    { 
     font-size: small; 
     height: 101px; 
     border-left-color: #808080; 
     border-right-color: #C0C0C0; 
     border-top-color: #808080; 
     border-bottom-color: #C0C0C0; 
     background-color: #996633; 
    } 
    </style> 
    </head> 
    <body> 
    <form id="form1" runat="server"> 
    <div> 
    <table style="width: 100%; height: 623px; margin-bottom: 0px;"> 
     <tr> 
      <td bgcolor="#996633" class="style3" colspan="3"> 
       Malaysia Car Booking System<br /> 
       <span class="style9">Your satisfaction is our Priority</span></td> 
     </tr> 
     <tr> 
      <td bgcolor="#CC6600" class="style6"> 
      </td> 
      <td bgcolor="#FF9900" class="style7" style="vertical-align: top"> 
       <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> 
      </td> 
      <td bgcolor="#CC6600" class="style8"> 
      </td> 
     </tr> 
     <tr> 
      <td bgcolor="#996633" class="style1" colspan="3"> 
      </td> 
     </tr> 
    </table> 
     </div> 
    </form> 
    </body> 
    </html> 
+0

は、あなたがメッセージを読みました問題は?解決runat = "server"タグタイトルに含める必要がありますか? – SLaks

答えて

3

を使用すると、マスターページに対応するContentPlaceHolderタグはありません、あなたのコンテンツページでContentタグを持っているということです。

マスターページ内の唯一のContentPlaceHolderタグがheadタグにあります。それは、コンテンツのページから任意のボディコンテンツを導入することが困難になるので、ボディタグには何も持っていないことはまれです。あなたはおそらくContentPlaceHolderタグであることを意図したPlaceHolderタグを身体に持っていますか?

2

あなたのページには<asp:content>のタグがあり、MasterPageの<asp:ContentPlaceHolder>のコントロールに対応していないようです。ソリューション、マスターページのこのタイプの

<!-- -->

これはあなたのエラーを引き起こしている可能性があります形式でコメントをサポートしていません。

+0

1 ...ありがとう私は決してそれを知らなかった。私の問題を解決した! – writeToBhuwan

0

非常に単純なマスターページを作成したときに同じエラーが発生し、Visual Studioでそのマスターページに基づいて通常のページを作成させました。ウェブサイトを実行した後、エラーメッセージが表示されなくなりました。エラーメッセージが古いマスターページに基づいていて、そのビジュアルスタジオが変更されたマスターページをウェブサイトが実際に実行された後にのみ使用されたように思えました。奇妙な:-(

0

あなたはほとんどの時間は、それはあなたが理解していない何

関連する問題