在这里由于类库太大了,所以只提供部分实现
1.default.aspx
2.
3.
1.default.aspx
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
%>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title > Untitled Page </ title >
< link href ="StyleSheet.css" rel ="stylesheet" type ="text/css" />
</ head >
< body >
< form id ="form1" runat ="server" >
< asp:ScriptManager ID ="ScriptManager1" runat ="server" />
< asp:DataList ID ="dlMenuBig" runat ="server" Width ="850px" OnItemDataBound ="dlMenuBig_ItemDataBound" >
< ItemTemplate >
< table border ="1" cellpadding ="0" cellspacing ="0" class ="bordercolor" >
< tr >
< td class ="td_c" >
< asp:Label ID ="lblId" runat ="server" Text ='<%#Eval("MenuBig_Id") % > ' Visible="false"> </ asp:Label >
< a href ="SmallClassList.aspx?bigid=<%#Eval(" MenuBig_Id") % > ">
< font > <% #Eval("MenuBig_Name") %> </ font ></ a > < img alt ="http://www.yyzyq.com" src ="images/team2.gif" /> 区长: <% #Eval("MenuBig_Admin") %>
</ td >
</ tr >
< tr >
< td >
< asp:DataList ID ="dlMenuSmall" runat ="server" BorderStyle ="None" Width ="850px" OnItemDataBound ="dlSmall_ItemDataBound" >
< ItemTemplate >
< table border ="1" class ="bordercolor" cellpadding ="0" cellspacing ="0" >
< tr >
< td >
< table border ="0" cellpadding ="0" cellspacing ="0" style ="width: 850px" >
< tr >
< td rowspan ="3" style ="width: 40px" >
< asp:Label ID ="lblSmallId" runat ="server" Text ='<%#Eval("MenuSmall_Id") % > ' Visible="false"> </ asp:Label >< img id ="imgToday" runat ="server" alt ="http://www.yyzyq.com" src ="images/day1.gif" width ="40" /></ td >
< td colspan ="2" style ="width:360px" >
< a href ="PostList.aspx?smallid=<%#Eval(" MenuSmall_Id") % > "> <% #Eval("MenuSmall_Name") %> </ a ></ td >
< td style ="width:100px" >
今日: < asp:Label ID ="lblToday" runat ="server" Text ='<%#Eval("MenuSmall_ToDayPostCount") % > '> </ asp:Label ></ td >
< td rowspan ="3" style ="width: 70px" align ="center" >
< img alt ="http://www.yyzyq.com" src ="<%#Eval(" MenuSmall_ImgUrl") % > " width="60" />
</ td >
< td style ="width: 300px" >
标题: < a href ="BrowsePost.aspx?smallid=<%#Eval(" MenuSmall_Id") % > &postid = <% #Eval("Post_Id") %> "> <% #Eval("Post_Title") %> </ a ></ td >
</ tr >
< tr >
< td colspan ="2" >
< img alt ="http://www.51aspx.com" src ="images/Forum_readme.gif" />
< img alt ="http://www.51aspx.com" src ="images/descripte.gif" />< a href ="PostList.aspx?smallid=<%#Eval(" MenuSmall_Id") % > "> <% #Eval("MenuSmall_Description") %> </ a ></ td >
< td >
帖子: <% #Eval("MenuSmall_PostCount") %> </ td >
< td >
发帖: < a href ="BrowseUserInfo.aspx?id=<%#Eval(" User_Id") % > "> <% #Eval("User_Name") %> </ a >< img src ="images/lastpost.gif" /></ td >
</ tr >
< tr >
< td >
< img alt ="http://www.51aspx.com" src ="images/team2.gif" /> 版主: <% #Eval("MenuSmall_Admin") %> </ td >
< td align ="right" >
<!-- <asp:ImageButton ID="ibtnSendPost" runat="server" ImageUrl="~/images/ipost1.gif" CommandName="SendPost" /> --> </ td >
< td >
回复: <% #Eval("MenuSmall_PostBackCount") %> </ td >
< td >
时间: <% #Eval("Post_SendTime") %> </ td >
</ tr >
</ table >
</ td >
</ tr >
</ table >
</ ItemTemplate >
</ asp:DataList >
</ td >
</ tr >
</ table >< br />
</ ItemTemplate >
</ asp:DataList >
< div >
< a href ="Default.aspx" ></ a > </ div >
</ form >
</ body >
</ html >
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title > Untitled Page </ title >
< link href ="StyleSheet.css" rel ="stylesheet" type ="text/css" />
</ head >
< body >
< form id ="form1" runat ="server" >
< asp:ScriptManager ID ="ScriptManager1" runat ="server" />
< asp:DataList ID ="dlMenuBig" runat ="server" Width ="850px" OnItemDataBound ="dlMenuBig_ItemDataBound" >
< ItemTemplate >
< table border ="1" cellpadding ="0" cellspacing ="0" class ="bordercolor" >
< tr >
< td class ="td_c" >
< asp:Label ID ="lblId" runat ="server" Text ='<%#Eval("MenuBig_Id") % > ' Visible="false"> </ asp:Label >
< a href ="SmallClassList.aspx?bigid=<%#Eval(" MenuBig_Id") % > ">
< font > <% #Eval("MenuBig_Name") %> </ font ></ a > < img alt ="http://www.yyzyq.com" src ="images/team2.gif" /> 区长: <% #Eval("MenuBig_Admin") %>
</ td >
</ tr >
< tr >
< td >
< asp:DataList ID ="dlMenuSmall" runat ="server" BorderStyle ="None" Width ="850px" OnItemDataBound ="dlSmall_ItemDataBound" >
< ItemTemplate >
< table border ="1" class ="bordercolor" cellpadding ="0" cellspacing ="0" >
< tr >
< td >
< table border ="0" cellpadding ="0" cellspacing ="0" style ="width: 850px" >
< tr >
< td rowspan ="3" style ="width: 40px" >
< asp:Label ID ="lblSmallId" runat ="server" Text ='<%#Eval("MenuSmall_Id") % > ' Visible="false"> </ asp:Label >< img id ="imgToday" runat ="server" alt ="http://www.yyzyq.com" src ="images/day1.gif" width ="40" /></ td >
< td colspan ="2" style ="width:360px" >
< a href ="PostList.aspx?smallid=<%#Eval(" MenuSmall_Id") % > "> <% #Eval("MenuSmall_Name") %> </ a ></ td >
< td style ="width:100px" >
今日: < asp:Label ID ="lblToday" runat ="server" Text ='<%#Eval("MenuSmall_ToDayPostCount") % > '> </ asp:Label ></ td >
< td rowspan ="3" style ="width: 70px" align ="center" >
< img alt ="http://www.yyzyq.com" src ="<%#Eval(" MenuSmall_ImgUrl") % > " width="60" />
</ td >
< td style ="width: 300px" >
标题: < a href ="BrowsePost.aspx?smallid=<%#Eval(" MenuSmall_Id") % > &postid = <% #Eval("Post_Id") %> "> <% #Eval("Post_Title") %> </ a ></ td >
</ tr >
< tr >
< td colspan ="2" >
< img alt ="http://www.51aspx.com" src ="images/Forum_readme.gif" />
< img alt ="http://www.51aspx.com" src ="images/descripte.gif" />< a href ="PostList.aspx?smallid=<%#Eval(" MenuSmall_Id") % > "> <% #Eval("MenuSmall_Description") %> </ a ></ td >
< td >
帖子: <% #Eval("MenuSmall_PostCount") %> </ td >
< td >
发帖: < a href ="BrowseUserInfo.aspx?id=<%#Eval(" User_Id") % > "> <% #Eval("User_Name") %> </ a >< img src ="images/lastpost.gif" /></ td >
</ tr >
< tr >
< td >
< img alt ="http://www.51aspx.com" src ="images/team2.gif" /> 版主: <% #Eval("MenuSmall_Admin") %> </ td >
< td align ="right" >
<!-- <asp:ImageButton ID="ibtnSendPost" runat="server" ImageUrl="~/images/ipost1.gif" CommandName="SendPost" /> --> </ td >
< td >
回复: <% #Eval("MenuSmall_PostBackCount") %> </ td >
< td >
时间: <% #Eval("Post_SendTime") %> </ td >
</ tr >
</ table >
</ td >
</ tr >
</ table >
</ ItemTemplate >
</ asp:DataList >
</ td >
</ tr >
</ table >< br />
</ ItemTemplate >
</ asp:DataList >
< div >
< a href ="Default.aspx" ></ a > </ div >
</ form >
</ body >
</ html >
2.
using
System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WeYyzyq.Logic;
public partial class _Default : System.Web.UI.Page
{
Bbs_MenuBig menubig = new Bbs_MenuBig();
Bbs_MenuSmall menusmall = new Bbs_MenuSmall();
protected void Page_Load(object sender, EventArgs e)
{
menubig.BindMenuBig(dlMenuBig);
}
protected void dlMenuBig_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
menusmall.BindMenuSmallBig((DataList)e.Item.FindControl("dlMenuSmall"), ((Label)e.Item.FindControl("lblId")).Text);
}
}
}
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WeYyzyq.Logic;
public partial class _Default : System.Web.UI.Page
{
Bbs_MenuBig menubig = new Bbs_MenuBig();
Bbs_MenuSmall menusmall = new Bbs_MenuSmall();
protected void Page_Load(object sender, EventArgs e)
{
menubig.BindMenuBig(dlMenuBig);
}
protected void dlMenuBig_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
menusmall.BindMenuSmallBig((DataList)e.Item.FindControl("dlMenuSmall"), ((Label)e.Item.FindControl("lblId")).Text);
}
}
}
3.