Discuz下拉树形框控件

昨天发现简单的改进的下拉树形框控件,和大家一起分享

控件代码:

Discuz下拉树形框控件 Code


使用方法:

页面aspx代码:

<%@ Register TagPrefix="cc2" Namespace="Discuz.Control" Assembly="Discuz.Control" %>

<div id="showtargetforum" runat="server">

 <cc2:DropDownTreeList id="targetforumid" runat="server" Visible="true"></cc2:DropDownTreeList>

</div>

*.apsx.cs代码:  

  public void InitInfo()

        {
            #region 初始化信息绑定
            targetforumid.BuildTree(DatabaseProvider.GetInstance().GetForumsTree());
//绑定SQL语句
 if (DNTRequest.GetString("fid") != "")
            {
                targetforumid.SelectedValue = DNTRequest.GetString("fid");
                //addtype.SelectedValue = "1";
                targetforumid.Visible = true;
            }
  #endregion

}

你可能感兴趣的:(discuz)