我需要有关嵌套在ASP.NET的creationg的帮助!
问题描述:
我正在尝试创建一个基于Web的应用程序。这个基于Web的应用程序应该有Header,Main Contet,它在其他三个
I''m trying to create a web based application. This web based application it should have Header, Main Contet which is separated in three other
中分开,如Left,Center和Right。
最后它有一个页脚。
在左边的DIV我想放置网站链接,在中间一个页面的内容和右边的div我想放一些新闻。
问题是我知道如何创建在HTML中嵌套div-s但我不知道在 site.master 中创建div的位置。
如果我将div-s放在main内容将它们置于内容之下,而不是放在同一行内容中。
我希望有人可以帮助我解决这个问题。
这是我尝试的一些代码:
最后它有一个页脚。
在左边的DIV我想放置网站链接,在中间一个页面的内容和右边的div我想放一些新闻。
问题是我知道如何创建在HTML中嵌套div-s但我不知道在 site.master 中创建div的位置。
如果我将div-s放在main内容将它们置于内容之下,而不是放在同一行内容中。
我希望有人可以帮助我解决这个问题。
这是我尝试的一些代码:
like Left, Center and Right.
At the end it has a footer to.
In the left DIV i want to put site links, in center one the content of a page and in the right div i want to put some news.
The problem is that i know how to create nested div-s in HTML but I don#t know where to place the div-s I create in site.master.
If I place the div-s at main content it places them under the content, not in the same line of content.
I hope someone can help me to solve this problem.
Here is some code I try:
At the end it has a footer to.
In the left DIV i want to put site links, in center one the content of a page and in the right div i want to put some news.
The problem is that i know how to create nested div-s in HTML but I don#t know where to place the div-s I create in site.master.
If I place the div-s at main content it places them under the content, not in the same line of content.
I hope someone can help me to solve this problem.
Here is some code I try:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="ScoMan.SiteMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<div class="page">
<div class="header">
<div class="title">
<h1>
My ASP.NET Application
</h1>
</div>
<div class="loginDisplay">
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
<AnonymousTemplate>
[ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
</AnonymousTemplate>
<LoggedInTemplate>
Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
[ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
</LoggedInTemplate>
</asp:LoginView>
</div>
<div class="clear hideSkiplink">
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
</Items>
</asp:Menu>
</div>
</div>
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
<div id="majtas">
<asp:Menu ID="Menu1" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Vertical">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
</Items>
</asp:Menu>
</div>
</div>
<div class="clear">
</div>
</div>
<div class="footer">
</div>
</form>
</body>
</html>
如您所见,垂直菜单栏位于页面内容之下。
提前感谢您的回复。
As you can see the vertical menubar is places under the content of page.
Thank you in advance for your reply.
答
如果你真的想要这个设计,为什么不使用 HTML< table>标记 [ ^ ]?
祝你好运
Espen Harlinn
If you really want that design, why not use the HTML <table> Tag[^]?
Best regards
Espen Harlinn