使用 c# asp.net 网络表单的嵌套中继器
Nested Repeater using c# asp.net web forms
实际上我没有得到任何使用嵌套转发器的逻辑 asp.net c#。
下面是我的sqlTable
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
我希望在 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
或者实现上述输出的任何其他逻辑,Session-1 应该首先按 Session-1、Session-2 和 Session-3 的顺序排列。
我建议使用 "Session" 列上的 GROUP BY
从 SQL 数据库查询。
然后在中继器中有一个具有您需要的样式的自定义模板(每个组的 Header 具有 Session 名称)。
找到下面的 link 以了解如何按数据分组并在 Repeater 中使用它。
您将必须根据您的要求进行定制。但是你会知道如何前进。
实际上我没有得到任何使用嵌套转发器的逻辑 asp.net c#。
下面是我的sqlTable
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
我希望在 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
或者实现上述输出的任何其他逻辑,Session-1 应该首先按 Session-1、Session-2 和 Session-3 的顺序排列。
我建议使用 "Session" 列上的 GROUP BY
从 SQL 数据库查询。
然后在中继器中有一个具有您需要的样式的自定义模板(每个组的 Header 具有 Session 名称)。
找到下面的 link 以了解如何按数据分组并在 Repeater 中使用它。 您将必须根据您的要求进行定制。但是你会知道如何前进。