关闭

ASP.NET-DataList控件-DataList嵌套

13人阅读 评论(0) 收藏 举报
<span class="token lf"></span><pre style="width: 784px; height: 593px;" id="wmd-input" class="form-control font-rich has-selection"><pre name="code" class="html">
在设计页面的时候,通常会碰到以下情况:
<pre style="width: 784px; height: 593px;" id="wmd-input" class="form-control font-rich has-selection"><span class="wmd-input-section" id="wmd-input-section-121"><span class="token p">1.在页面点击一个选项,需要查询数据库,得到其</span><span class="token lf">
</span><span class="token lf">
</span><span class="token p">一、前台代码</span><span class="token lf">
</span><span class="token lf">
</span><span class="token p"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token namespace">asp:</span>DataList</span> <span class="token attr-name">ID</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>ParentDataList<span class="token punctuation">"</span></span> <span class="token attr-name">runat</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>server<span class="token punctuation">"</span></span> <span class="token attr-name">OnItemDataBound</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>ParentDataList_OnItemDataBound<span class="token punctuation">"</span></span><span class="token punctuation">></span></span></span><span class="token lf">
</span><span class="token p">	<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>ItemTemplate</span><span class="token punctuation">></span></span></span><span class="token lf">
</span><span class="token p">	<%#DataBimder.Eval(Container.DataItem,"parent")%> </span><span class="token lf">
</span><span class="token p">	<span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token namespace">asp:</span>DataList</span> <span class="token attr-name">ID</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>ChildDataList<span class="token punctuation">"</span></span> <span class="token attr-name">runat</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>server<span class="token punctuation">"</span></span><span class="token punctuation">></span></span></span><span class="token lf">
</span><span class="token p">	<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>ItemTemplate</span><span class="token punctuation">></span></span></span><span class="token lf">
</span><span class="token p">		<%#DataBimder.Eval(Container.DataItem,"child")%> </span><span class="token lf">
</span><span class="token p">	<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>ItemTemplate</span><span class="token punctuation">></span></span></span><span class="token lf">
</span><span class="token p">	<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token namespace">asp:</span>DataList</span><span class="token punctuation">></span></span></span><span class="token lf">
</span><span class="token p">	<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>ItemTemplate</span><span class="token punctuation">></span></span></span><span class="token lf">
</span><span class="token p"><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token namespace">asp:</span>DataList</span><span class="token punctuation">></span></span></span><span class="token lf"></span></span>



   
0
0

猜你在找
【直播】机器学习&数据挖掘7周实训--韦玮
【套餐】系统集成项目管理工程师顺利通关--徐朋
【直播】3小时掌握Docker最佳实战-徐西宁
【套餐】机器学习系列套餐(算法+实战)--唐宇迪
【直播】计算机视觉原理及实战--屈教授
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之矩阵--黄博士
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之凸优化--马博士
【套餐】Javascript 设计模式实战--曾亮
查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:15次
    • 积分:10
    • 等级:
    • 排名:千里之外
    • 原创:1篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章存档