如何根据选定的类别ID在数据列表中显示数据? [英] how to display data in datalist according to selected category id ?
本文介绍了如何根据选定的类别ID在数据列表中显示数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在建立目录网站,我想根据类别ID显示详细信息.
所以请帮助我们
Thnx&问候
克里希纳
krishnjaiswal4u@gmail.com
I am making a directory website and i wanna to display the details according to category id.
so plz help us
Thnx & Regards
krishna
krishnjaiswal4u@gmail.com
推荐答案
我找到了一个有用的链接.
层叠下拉列表.
I found one useful link for the same.
Cascading Dropdown.
<asp:DataList ID="dtCategoryList" runat="server" Visible="true" CellPadding="4" RepeatColumns="4" RepeatDirection="Horizontal" CellSpacing="35" HorizontalAlign="left" Width="185px" >
<ItemTemplate>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="center" height="30px">
<asp:LinkButton Font-Underline="false" ID="lblMoodName" runat="server" Text='<%# Eval ("CategoryName").ToString ().Length > 20 ? Eval ("CategoryName").ToString ().Substring (0, 20) + "..." : Eval("CategoryName").ToString ()%>' ToolTip='<%# Eval ("CategoryName")%>' CommandArgument='<%# Eval("CategoryId")%>' ></asp:LinkButton>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
在服务器端根据geatory ID和
获取详细信息
In server side Get the details based on geatory id and
dtCategoryList.DataSource = dtDetails;
dtCategoryList.DataBind();
这篇关于如何根据选定的类别ID在数据列表中显示数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文