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中运用DataList控件来实现编辑、更新、删除、取消等功能

1、前台设计               .style2         {             width: 67px;         }           ...

ASP.NET Web Forms - DataList 控件

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

asp.net学习之DataList控件

DataList控件与Repeater控件一样由模板驱动,与Repeater控件不同的是: DataList控件默认输出是一个HTML表格.DataList在输出时已经在相应的模板上套上了表格标签,而...
  • judyge
  • judyge
  • 2016年09月25日 11:44
  • 615

在ASP.NET中使用DataList控件.rar

  • 2010年07月02日 10:59
  • 6.96MB
  • 下载

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

本文利用PagedDataSource+Repeater控件实现数字分页, DataList控件也可以通过修改ID名称实现分页。 /// /// Repeater分页 /// /// DataS...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:ASP.NET-DataList控件-DataList嵌套
举报原因:
原因补充:

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