以前用过动易的系统,频道下的每添加一个栏目,该频道首页就会显示出相应栏目,并调用该栏目中的文章列表!请问,如用asp.net实现这个功能?并指定调用的数量?

解决方案 »

  1.   

    做隐藏,如果显示的话.则填充里边的数据.
    隐藏状态则不加载里边的数据.每一个栏目可以是一个div
      

  2.   

    可有Repeater套Repeater的方法实现
      

  3.   

    就是类似于:http://music.xunlei.com/
    迅雷音乐频道里面的"内地音乐","港台音乐","日韩音乐","欧美音乐".....
    这些区块,如何让其自动生成?
      

  4.   

    给你我测试成功后的,此分的接定了
    ASPX:
    <asp:Repeater id="repCatelog" runat="server" OnItemDataBound="repCatelog_ItemDataBound"> 
        <ItemTemplate>
    <div class="claer"></div>
    <fieldset><legend class="MT"><a href="b_s_<%# DataBinder.Eval(Container.DataItem,"RootID")%>.aspx" title="<%# DataBinder.Eval(Container.DataItem,"ClassName")%>"><%# DataBinder.Eval(Container.DataItem,"ClassName")%></a></legend><!--大类-->
    <!--小类开始循环-->
    <ul class="Category">
    <asp:Repeater id="repsubCatalog" runat="server"> 
    <ItemTemplate>
    <li><a href="s_s_<%# DataBinder.Eval(Container.DataItem,"ArticleID")%>.aspx" title="<%# DataBinder.Eval(Container.DataItem,"title")%>"><%# DataBinder.Eval(Container.DataItem,"title")%></a></li>
    </ItemTemplate>
    </asp:Repeater>
    </ul><!--小类的结束-->
    </fieldset> 
    </ItemTemplate> 
    </asp:Repeater>CS:(根据动易的数据表,如何邦定数据自己改一下)    //在绑定主栏目时,绑定分类下的文章 
        protected void repCatelog_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater repsubCatalog = (Repeater)e.Item.FindControl("repsubCatalog");             DataRowView rowv = (DataRowView)e.Item.DataItem; 
                int getbid = Convert.ToInt32(rowv["RootID"]); 
                string Root_sql_2 = "select top 60 ArticleId,title from [Article] where Deleted=0 and Passed=1 and ClassId in (select ClassID from ArticleClass where RootID=" + getbid + ") order by ArticleId desc";
                DataTable Root_dt_2 = jtwq_db.GetDataTable(Root_sql_2);
                repsubCatalog.DataSource = Root_dt_2.DefaultView;
                repsubCatalog.DataBind();
            }
        }
      

  5.   

    楼主可能误解我的意思了
    就是类似于:http://music.xunlei.com/ 
    迅雷音乐频道里面的"内地音乐","港台音乐","日韩音乐","欧美音乐"..... 
    这些区块,如何让其根据数据库中的分类自动生成?
      

  6.   


    楼上可能误解我的意思了 
    就是类似于:http://music.xunlei.com/ 
    迅雷音乐频道里面的"内地音乐","港台音乐","日韩音乐","欧美音乐"..... 
    这些区块,如何让其根据数据库中的分类自动生成?