ASP.NET-DataList控件-DataList嵌套

原创 2015年07月10日 20:57:12
<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>




            
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

asp.net DataList控件分页代码

ASP.NET动态网站开发培训-16.DataList控件(三)

第十六讲:DataList控件(三) 课程安排:

ASP.NET Web Forms - DataList 控件

DataList 控件,类似于 Repeater 控件,用于显示绑定在该控件上的项目的重复列表。不过,DataList 控件会默认地在数据项目上添加表格。 绑定 DataSet 到 Data...

ASP.NET中Repeater控件和DataList控件通用的分页类

本文利用PagedDataSource+Repeater控件实现数字分页, DataList控件也可以通过修改ID名称实现分页。 /// /// Repeater分页 /// /// DataS...

Asp.net 用datalist嵌套的方法实现二级菜单的分类导航

刚开始学习Asp.net做网站的时候, 做的是一个电子图书购买网站,发现图书有多级类目。   例如:小说分类下面世界名著,中国古典小说.......  文学类目下有 文学理论 中国古典诗歌。 这些要是...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)