且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何根据选定的类别ID在数据列表中显示数据?

更新时间:2023-11-30 15:52:58

我找到了一个有用的链接.

层叠下拉列表.
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();