topiclist.aspx.cs
来自「一个功能完善的论坛系统,有数据库备分,希望对你有所帮助」· CS 代码 · 共 82 行
CS
82 行
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace bbs.Admin
{
/// <summary>
/// TopicList 的摘要说明。
/// </summary>
public class TopicList : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DropDownList FunctionList;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.DataGrid dgrTopicList;
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
DataFunction();
DataList("");
}
}
private void DataFunction()
{
bbs.Components.DiscussionDB Forum=new bbs.Components.DiscussionDB();
DataSet ds=Forum.GetFunctionList();
FunctionList.DataSource=ds;
FunctionList.DataTextField="FunctionName";
FunctionList.DataValueField="FunctionID";
FunctionList.DataBind();
}
private void DataList(string strFunctionID)
{
if (strFunctionID=="")
{
strFunctionID = this.FunctionList.SelectedValue;
}
bbs.Components.DiscussionDB Forum=new bbs.Components.DiscussionDB();
DataSet ds=Forum.GetTopicByFunction(strFunctionID,false);
dgrTopicList.DataSource=ds;
dgrTopicList.DataBind();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.FunctionList.SelectedIndexChanged += new System.EventHandler(this.FunctionList_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void FunctionList_SelectedIndexChanged(object sender, System.EventArgs e)
{
DataList(FunctionList.SelectedValue);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?