更新时间:2023-02-05 16:08:16
用以下内容替换母版页内容,并更改徽标和树视图节点.
Replace Master Page content with following and change your logo and treeview nodes.
<%@ 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>Untitled Page</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
}
.style3
{
width: 70%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="style1">
<tr>
<td colspan="2">
<asp:Image ID="Image1" runat="server" Height="100px" ImageUrl="~/ajaxhead.png"
Width="100%" />
</td>
</tr>
<tr>
<td class="style2" colspan="2" >
</td>
</tr>
<tr>
<td class="style2" style="text-align: left" >
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="Home" Value="Home"></asp:TreeNode>
<asp:TreeNode Text="About Us" Value="About Us"></asp:TreeNode>
</Nodes>
</asp:TreeView>
</td>
<td class="style3">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder></td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
之后,从解决方案资源管理器中选择添加新项",并在添加新项"对话框中选中选择母版页.
After that Select Add New Item from Solution Explorer, with checked Select Master Page in Add New Item Dialog box.