(Master Page first):
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Menu.master.cs" Inherits="KaysCakes.Master.Menu" %>
<!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>Kays Cakery</title>
<link href="~/Styles/Content.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="smMain" runat="server">
</asp:ScriptManager>
<div class="main">
<asp:ContentPlaceHolder ID="cphMainBody" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
(ASPX Page)
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Master/Menu.Master" CodeBehind="Administration.aspx.cs" Inherits="KaysCakes.Administration" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="head">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="cphMainBody">
<asp:Panel ID="pnlAdminChoice" runat="server">
<asp:DropDownList ID="ddlAdminChoices" runat="server" DataValueField = "ID"
DataTextField="TableName" AutoPostBack="true"
onselectedindexchanged="ddlAdminChoices_SelectedIndexChanged">
</asp:DropDownList>
</asp:Panel>
<asp:Panel ID="pnlCategory" runat="server">
category
</asp:Panel>
<asp:Panel ID="pnlCity" runat="server">
city
</asp:Panel>
<asp:Panel ID="pnlDelivery" runat="server">
delivery
</asp:Panel>
<asp:Panel ID="pnlFilling" runat="server">
filling
</asp:Panel>
<asp:Panel ID="pnlIcing" runat="server">
icing
</asp:Panel>
<asp:Panel ID="pnlMember" runat="server">
member
</asp:Panel>
<asp:Panel ID="pnlMemberType" runat="server">
memberType
</asp:Panel>
<asp:Panel ID="pnlOccassion" runat="server">
occassion
</asp:Panel>
<asp:Panel ID="pnlOrder" runat="server">
order
</asp:Panel>
<asp:Panel ID="pnlPayment" runat="server">
payment
</asp:Panel>
<asp:Panel ID="pnlProduct" runat="server">
product
</asp:Panel>
<asp:Panel ID="pnlStatus" runat="server">
status
</asp:Panel>
</asp:Content>
Also here is my code behind file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace KaysCakes
{
public partial class Administration : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ddlAdminChoices.SelectedIndexChanged += new EventHandler(ddlAdminChoices_SelectedIndexChanged);
if (!Page.IsPostBack)
{
HideAllPanels();
FillAdminListDDL();
ddlAdminChoices.Items.Insert(0, new ListItem("", "-1"));
}
}
private void FillAdminListDDL()
{
List<KaysCakes.Contracts.Data.TableDto> list = new List<Contracts.Data.TableDto>();
KaysCakesClasses.Searcher searcher = new KaysCakesClasses.Searcher();
list = searcher.GetAllTables();
ddlAdminChoices.DataSource = list;
ddlAdminChoices.DataBind();
}
private void HideAllPanels()
{
this.pnlCategory.Visible = false;
this.pnlCity.Visible = false;
this.pnlDelivery.Visible = false;
this.pnlFilling.Visible = false;
this.pnlIcing.Visible = false;
this.pnlMember.Visible = false;
this.pnlMemberType.Visible = false;
this.pnlOccassion.Visible = false;
this.pnlOrder.Visible = false;
this.pnlPayment.Visible = false;
this.pnlProduct.Visible = false;
this.pnlStatus.Visible = false;
}
protected void ddlAdminChoices_SelectedIndexChanged(object sender, EventArgs e)
{
HideAllPanels();
if (this.ddlAdminChoices.SelectedValue == "1")
{
pnlCategory.Visible = true;
}
}
}
}
And finally, here is my CSS in question:
.main
{
width:960px;
margin-left: auto;
margin-right: auto;
margin-top: -5px;
min-height: 525px;
background: url(../Images/parchmentbase.jpg);
}
Any ideas?

New Topic/Question
Reply




MultiQuote



|