Exemple #1
0
 //绑定平台
 private void TreeBind()
 {
     Spread.BLL.Menu cbll = new Spread.BLL.Menu();
     DataTable dt = cbll.GetList("").Tables[0];
     ddlMenu.DataSource = dt;
     ddlMenu.DataTextField = "Title";
     ddlMenu.DataValueField = "ID";
     ddlMenu.DataBind();
     ListItem item = new ListItem("请选择所属平台...", "0");
     ddlMenu.Items.Insert(0, item);
 }
Exemple #2
0
        public string MenuInfo()
        {
            StringBuilder html = new StringBuilder();
            Spread.BLL.Menu bllMenu = new Spread.BLL.Menu();
            DataTable dt = bllMenu.GetList(10, "IsMenu=true", "ID Desc").Tables[0];
            if (dt.Rows.Count > 0)
            {
                html.Append("<ul>");
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    html.Append("<li> <a href=\"/Product/Default.aspx?pid=" + dt.Rows[i]["ID"].ToString() + "\">" + dt.Rows[i]["Title"].ToString() + "</a>");
                    html.Append(ProductInfo(dt.Rows[i]["ID"].ToString()));
                    html.Append("</li>");
                }
                html.Append("</ul>");
            }
            return html.ToString();

        }