PDA

View Full Version : سوال: master page عمودی



بودای شرقی
سه شنبه 15 آذر 1390, 20:34 عصر
سلام
من میخوام توی master page که طراحی کردم علاوه بر header و footer یک منو در قسمت اصلی صفحه داشته باشد اگه کسی کمک کنه ممنون میشم.
این هم کد master page که طراحی کردم.
[code]
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="My_Web.Site1" %>

<!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">
<link href =StyleSheet.css rel =Stylesheet type ="text/css" />
<title>My Website</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div><center >
<img src =big_img1.jpg width="100%" height="250" />
</center>
<center >
<div style="width: 80%; height: 26px; margin-left: 0px;" class="font " >
&nbsp;<input type =text style="height: 37px" class ="search "/>&nbsp;
<input type =button value ="جستجو" style="height: 37px" class ="menu " />&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;
<input type =button value ="در باره ما" style="height: 37px" class ="menu " />
<input type =button
value ="تماس با ما" style="height: 37px" class ="menu " />
<input type =button
value ="کاربران حاضر" style="height: 37px" class ="menu " />
<input type =button
style=" height: 37px;" value ="ورود" class ="menu " />&nbsp;&nbsp;
</div>
</center><br />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>
<br />
<center><div class ="footer " ><br />Design By buda<br />
2011
</div>
</center></div>
</div>
</form>
</body>
</html>
[code]

dorparasti
سه شنبه 15 آذر 1390, 23:34 عصر
خیلی بد نوشتی .... مرتب تر بنویس و بیشتر کد ببین ....

می خوای توی هر Page مطلب جداگانه ای بذاری یا نه یک بخش ثابت در همه صفحاته ?
در هر صورت برای اینکار در قسمت اصلی سایت که محتویات قرار می گیره و بهش Content میگیم برای مثال . می تونی 2 یا بر حسب نیاز 3 Div قرار بدی که یک یا دو تای اون به عنوان SideBar باشن . برای تنظیم کردنشون هم float اون side bar ها رو به right و left تنظیم کن . مثل زیر که سعی کردم کد خودتو درست کنم . ببین متوجه میشی


<%@ Master Language="C#‎" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="My_Web.Site1" %>

<!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 id="Head1" runat="server">
<link href =StyleSheet.css rel =Stylesheet type ="text/css" />
<title>My Website</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<style>
#SideBar
{
float:right;
width:30%;
display:inline-block;
background-color:#e2e2e2;
}
#MainContent
{
width:70%;
display:inline-block;
float:left;

}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="Container">
<div id="Banner" style="text-align:center; width:100%">
<img src =big_img1.jpg width="100%" height="250" />
</div>
<div id="Header" style="width:100%; height:26px;" class="font" >
<input type =text style="height: 37px" class ="search "/>&nbsp;
<input type =button value ="جستجو" style="height: 37px" class ="menu " />
<input type =button value ="در باره ما" style="height: 37px" class ="menu " />
<input type =button
value ="تماس با ما" style="height: 37px" class ="menu " />
<input type =button
value ="کاربران حاضر" style="height: 37px" class ="menu " />
<input type =button
style=" height: 37px;" value ="ورود" class ="menu " />&nbsp;&nbsp;
</div>
<div id="Content">
<div id="SideBar"></div>
<div id="MainContent">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>
</div>
<div style="clear:both;width:100%; height:1px;"></div>
</div>
<div id="Footer" style="text-align:center;" ><br />Design By buda<br />
2011
</div>
</div>

</form>
</body>
</html>