以前用过动易的系统,频道下的每添加一个栏目,该频道首页就会显示出相应栏目,并调用该栏目中的文章列表!请问,如用asp.net实现这个功能?并指定调用的数量?
解决方案 »
- gridView问题,大家来看看啊。。
- 帮忙看看这几句话
- oracle 换行符的问题.超级郁闷啊!
- 1000分不管用,那就来真的,高手进
- 请教:父窗口调用iframe中数据的问题(需然有很多朋友问过了,但是我试过都不行啊)
- [Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'mn_id=631 and id
- 急!!!!服务器应用程序不可用
- 请教下关于asp.net MVC 实体数据模型问题
- 有什么办法能够共享那些相同的代码???
- 怎样才能设置TextBox的style属性?
- 在javascript中URL带中文参数问题,请帮忙看下!
- 有关gridview添加CommandField的问题,类型由link改为image就出问题,晕了
隐藏状态则不加载里边的数据.每一个栏目可以是一个div
迅雷音乐频道里面的"内地音乐","港台音乐","日韩音乐","欧美音乐".....
这些区块,如何让其自动生成?
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();
}
}
就是类似于:http://music.xunlei.com/
迅雷音乐频道里面的"内地音乐","港台音乐","日韩音乐","欧美音乐".....
这些区块,如何让其根据数据库中的分类自动生成?
楼上可能误解我的意思了
就是类似于:http://music.xunlei.com/
迅雷音乐频道里面的"内地音乐","港台音乐","日韩音乐","欧美音乐".....
这些区块,如何让其根据数据库中的分类自动生成?