申し訳ありません。私はVisual Web Developerを使って学校プロジェクトを作っています。私はマスターページを使う必要があります。マスターページに基づいて新しいWebフォームを作成すると、マスターページの色が継承されますが、継承されていないテーブルがあります。ここに私のマスターページのコードは次のとおりです。Webフォームが継承していないMicrosoft Visual Studioのマスターページ
<%@ Master Language="VB" CodeFile="Master1.master.vb" Inherits="Master1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server" background-color: #00FF00;>
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.auto-style2 {
height: 57px;
width: 2363px;
}
.auto-style3 {
height: 57px;
width: 48px;
}
.auto-style4 {
height: 48px;
}
.newStyle1 {
background-color: #FF00FF;
}
.auto-style5 {
width: 369px;
height: 214px;
}
</style>
</head>
<body style="background-color: blue;">
<form id="form1" runat="server">
<div class="newStyle1">
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
<table class="newStyle1">
<tr>
<td class="auto-style4" colspan="2">
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal">
<Items>
<asp:MenuItem NavigateUrl="Default.aspx" Text="Home" Value="Home"></asp:MenuItem>
<asp:MenuItem NavigateUrl="About.aspx" Text="About" Value="About"></asp:MenuItem>
</Items>
</asp:Menu>
</td>
</tr>
<tr>
<td class="auto-style3">
<img alt="CS Logo" class="auto-style5" src="cSk.png" /></td>
<td class="auto-style2">
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
<tr>
<td class="auto-style4" colspan="2"></td>
</tr>
</table>
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
マスターページVBコード:
Partial Class Master1
Inherits System.Web.UI.MasterPage
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
End Sub
End Class
Web Form Attempted to Inherit Master Page:
%@ Page Title="" Language="VB" MasterPageFile="~/Master1.master" %>
<script runat="server">
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
スクリプトを 'ContentPlaceHolderID =" head "'に入れてみてください。 – wazz
ありがとうございます。 divの外側にテーブルを動かすことで、私自身の問題を解決しました。 –