《有破解决版的动态导.doc》由会员分享,可在线阅读,更多相关《有破解决版的动态导.doc(9页珍藏版)》请在金锄头文库上搜索。
1、 有破解决版的,关键代码usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Xml.Linq;usingUIS
2、BLL;publicpartialclassDefault2:System.Web.UI.PageDataTableBT,ST;TreeServicesobjTreeServices=newTreeServices();/生成树/返回一个字符串inti=0;publicvoidMenuLoad()/查大分类表BT=objTreeServices.SelectAllBig_Class(Convert.ToInt32(SessionUsers_QX.ToString().Trim()0;/查小分类表ST=objTreeServices.SelectAllSmall_Class(Convert.To
3、Int32(SessionUsers_QX.ToString().Trim()0;DataRowdrs=BT.Select();foreach(DataRowrindrs)RadMenu1.Items.Add(newTelerik.Web.UI.RadMenuItem(rBigClass_Name.ToString();RadMenu1.Itemsi.PostBack=false;CreateNode(rBigClass_ID.ToString();i+;/添加子/根的ID/privatevoidCreateNode(stringparentid)/填充树枝的内容intj=0;DataRowd
4、rsr=ST.Select(BigClass_ID=+parentid);foreach(DataRowrwindrsr)RadMenu1.Itemsi.Items.Add(newTelerik.Web.UI.RadMenuItem(rwSmallClass_Name.ToString();RadMenu1.Itemsi.Itemsj.NavigateUrl=rwPath.ToString().Trim();j+;protectedvoidPage_Load(objectsender,EventArgse)if(!IsPostBack)/传入权限的ID在这里直接写了一个SessionUsers
5、_QX=5;MenuLoad();数据库设计源代码 下载地址http:/ 一个导航条的例子 大家快做项目了, 一定会想到过自己的导航条怎么做呢,这是我做的一个小例子,我个人让为呢还行,有那位朋友想用的话,我苏飞原把所有源码奉上,呵呵别忘了给我留言啊! 在.aspx源在的代码 无标题页 function showsubmenu(sid) whichEl = eval(document.getElementById(+submenu + sid+); imgmenu = eval(document.getElementById(+imgmenu + sid+); if (whichEl.style
6、.display = none) if (whichEl.style.display=none) whichEl.style.display=; else whichEl.style.display = none; imgmenu.background=image/menuup.gif; else if (whichEl.style.display=none) whichEl.style.display=; else whichEl.style.display = none; imgmenu.background=image/menudown.gif; 在.aspx.cs中的代码 using
7、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;using UISBLL;namespace buddy_BBS / / test 的摘要说明。 / public partial cla
8、ss left : System.Web.UI.Page public string text; DataTable BT, ST; TreeServices objTreeServices = new TreeServices(); / / 生成树 / / 返回一个字符串 public string MenuLoad() /填充树干的内容 string trees = , bs = ; int i = 1; BT = objTreeServices.SelectAllBig_Class(Convert.ToInt32(SessionUsers_QX.ToString().Trim()0; ST = objTreeServices.SelectAllSmall_Class(Convert.ToInt32(SessionUsers_QX.ToString().Trim()0; DataRow drs = BT.Select(); foreach (DataRow r in drs) trees += ; bs = + rbigclass_Name.ToString() + /f