日期:2014-05-17  浏览次数:20722 次

求助,导航栏排序问题?
本帖最后由 lincong19782 于 2013-03-30 10:27:53 编辑
各位大侠,请帮忙一下:
前台default.aspx
<%for (int i = 0; i <lists.Count; i++)

            { %> <%=classdic[lists[i]] %> <%} %>


后台cs代码:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;
namespace Maticsoft.Web.Article
{
    public partial class Detail : System.Web.UI.Page
    {
        protected Dictionary<string, string> classdic = new Dictionary<string, string>();//名称字典
        protected List<string> lists = new List<string>();//编号泛型
        protected Dictionary<string, int> orders = new Dictionary<string, int>();//排序号字典
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    GetClassList("135", 0);

                }
                else
                {
                    Response.Write("<script>alert('已经是最后一篇了!');history.back(1);</script>");
                }
            }
        }
        protected void GetClassList(string ParentID, int Layer)
        {

            IDataReader dr = ClassListDAL(ParentID);

            Dictionary<string, string> classdic1 = new Dictionary<string, string>();

            List<string> lists1 = new List<string>();

    &nb