首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

如何小弟我引用不了母版页?vs2005

2012-06-21 
怎么我引用不了母版页?vs2005母版页代码%@ Master LanguageC# AutoEventWireuptrue CodeFileMast

怎么我引用不了母版页?vs2005
母版页代码
<%@ 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>无标题页</title>
</head>
<body>
  <form id="form1" runat="server">
  <div>
  <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
  fdg fdgfgfg</asp:contentplaceholder>
  </div>
  </form>
</body>
</html>

Default2.aspx代码
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
Default2.aspx运行什么显示都没有,为什么?

[解决办法]

HTML code
<%@ 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>无标题页</title></head><body>  <form id="form1" runat="server">  <div>在这里可以写你要的mater内容  <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">  这里是用来放页面内容的</asp:contentplaceholder>  </div>  </form></body></html> 

热点排行