简体   繁体   English

使用C#ASP.NET Web表单的嵌套中继器

[英]Nested Repeater using c# asp.net web forms

Actually I am not getting any logic using nested repeater asp.net c#. 实际上,使用嵌套转发器asp.net c#并没有得到任何逻辑。

Below is my sql Table 下面是我的SQL表

DocID   Title                FileAttachment                      Session
69053   s3 time table       s3 time table_UserDetails.xls        Session-3
1616    Notice              Notice_UserDetails.xls               Session-1
67792   recruiment          recruiment_UserDetails.xls           Session-2
1616    Tesing              Testing_UserDetails.xls              Session-1

I want Output like below data session wise in Nested Repeater. 我想在嵌套中继器中像下面的数据会话一样明智地输出。

  Session-1
   Notice               Notice_UserDetails.xls               Session-1
   Tesing               Testing_UserDetails.xls              Session-1
  Session-2
   recruiment           recruiment_UserDetails.xls           Session-2
  Session-3
   s3 time table        s3 time table_UserDetails.xls        Session-3

Or Any other logic to achieve above output and Session-1 should be first order by ascending Session-1, Session-2 and Session-3. 或者,通过升序Session-1,Session-2和Session-3来实现上述输出和Session-1的任何其他逻辑应该是一阶的。

I would suggest to query from SQL DB with a GROUP BY on "Session" column. 我建议使用“会话”列上的GROUP BY从SQL DB查询。 Then in the repeater have a custom template with the styling you need (Header of each group with Session Name). 然后在转发器中有一个具有所需样式的自定义模板(每个组的标题带有“会话名称”)。

Find the link below for reference how to group by data and use it in Repeater. 查找下面的链接以参考如何按数据分组并在Repeater中使用它。 You will have to customize for your requirement. 您将必须根据需要进行自定义。 But you will get the idea how to go forward. 但是您会知道如何前进。

http://www.dotnetcurry.com/ShowArticle.aspx?ID=206 http://www.dotnetcurry.com/ShowArticle.aspx?ID=206

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM