2010-03-13 102 views
0

每一个 即时通讯新与ASP .NET,我不知道如何与ASP .nethelp我创建母版页PLZ如何设计母版页在ASP.net


这是我Masterpage标记:

<%@ 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> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
     &nbsp;<table style="width: 874px; height: 592px"> 
      <tr> 
       <td colspan="3" style="height: 9px"> 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 
        <asp:Label ID="Label1" runat="server" Font-Size="X-Large" ForeColor="#C0C000" Text="Sarth Enterprises"></asp:Label></td> 
      </tr> 
      <tr> 
       <td colspan="2" style="height: 15px"> 
        <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal"> 
         <Items> 
          <asp:MenuItem Text="Home" Value="Home"></asp:MenuItem> 
          <asp:MenuItem Text="Products" Value="Products"> 
           <asp:MenuItem Text="AE" Value="AE"></asp:MenuItem> 
           <asp:MenuItem Text="RSQE" Value="RSQE"></asp:MenuItem> 
           <asp:MenuItem Text="Comp. Hardware" Value="Comp. Hardware"></asp:MenuItem> 
          </asp:MenuItem> 
          <asp:MenuItem Text="Contact us" Value="Contact us"></asp:MenuItem> 
          <asp:MenuItem Text="About us" Value="About us"></asp:MenuItem> 
          <asp:MenuItem Text="FAQ" Value="FAQ"></asp:MenuItem> 
         </Items> 
        </asp:Menu> 
       </td> 
       <td style="width: 106px; height: 15px"> 
       </td> 
      </tr> 
      <tr> 
       <td style="width: 212px"> 
        <br /> 
        <asp:Label ID="Label3" runat="server" Text="Member Login"></asp:Label><br /> 
        <br /> 
        <br /> 
        <asp:Label ID="Label4" runat="server" Text="User ID:"></asp:Label> 
        &nbsp; &nbsp; 
        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
        &nbsp; &nbsp; 
        <br /> 
        <br /> 
        <br /> 
        <asp:Label ID="Label5" runat="server" Text="Password"></asp:Label> 
        &nbsp; &nbsp; 
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /> 
        <br /> 
        <br /> 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        <asp:Button ID="Button1" runat="server" Text="Login" /><br /> 
        <br /> 
        <br /> 
        <asp:Label ID="Label6" runat="server" Text="For new member,"></asp:Label> 
        <asp:HyperLink ID="HyperLink1" runat="server">Sign UP</asp:HyperLink></td> 
       <td style="width: 257px"> 
       </td> 
       <td style="width: 106px"> 
       </td> 
      </tr> 
      <tr> 
       <td colspan="3"> 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
        &nbsp; &nbsp; 
        <asp:Label ID="Label2" runat="server" Font-Bold="True" ForeColor="#C0C000" Height="19px" 
         Text="Copy right ,resereved @ Sarth enterprises" Width="284px"></asp:Label></td> 
      </tr> 
     </table> 
    </div> 
    </form> 
</body> 
</html> 
+0

你有什么试过?什么具体给你麻烦?你有麻烦写吗?你现在知道很热将内容页面关联到母版页吗? http://msdn.microsoft.com/en-us/library/wtxbf3hh.aspx –

回答

0

this MSDN页面(演练:创建和Visual Web Developer中使用ASP.NET母版页):

  • 在解决方案资源管理器中,用鼠标右键 - 单击您的网站的名称,然后单击添加新项目。
  • 在Visual Studio安装的模板下,单击主页面。
  • 在名称框中,键入Master1。
  • 选中单独的文件中的Place code复选框。
+0

是的,我做了所有这些事情.. 之后.. 我已经从主页面的设计端删除contentplaceholder ..然后我的 已经采取了3 * 3表1 ..然后我设计了一些结构.. 但调试和运行后,它没有显示任何输出屏幕 – Hussain

+0

如何更新您的问题和发布您的母版页的代码?这可能会给我们提供足够的线索来解决这个问题。 – Oded

0

从创建Oded提供的母版页开始,您希望离开“contentPlaceholders”。你可以添加更多,只要你认为合适。这是派生页面将使用的位置。

当您准备根据母版页创建页面时,单击为项目添加一个新窗体,单击复选框以使用“母版页”,然后为其指定新窗体的名称创造。当您点击确定时,它会提示您要根据哪个主页(您可以创建很多主页)。一旦被选中并且处于设计模式,它会以灰色显示外观,实际内容来自“主页面”,而内容占位符则是您将特定内容放置到该页面的位置。表格,网格,标签,等等。保存并运行,你会看到你的内容。然后,调整母版页并将某些内容放入公司徽标图形中,保存并运行第二个表单,您将看到它现在将具有新添加的徽标。

希望澄清它们的工作原理...另外,您还可以将CSS文件拖放到母版页上,以便在整个电路板上应用样式格式。