2010-03-13 42 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文件拖放到母版頁上,以便在整個電路板上應用樣式格式。