惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
T
Troy Hunt's Blog
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Schneier on Security
罗磊的独立博客
T
The Exploit Database - CXSecurity.com
博客园 - 司徒正美
月光博客
月光博客
C
Cybersecurity and Infrastructure Security Agency CISA
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Project Zero
Project Zero
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Latest news
Latest news
L
Lohrmann on Cybersecurity
阮一峰的网络日志
阮一峰的网络日志
C
CERT Recently Published Vulnerability Notes
腾讯CDC
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
T
Threat Research - Cisco Blogs
T
Tenable Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - Franky
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
Attack and Defense Labs
Attack and Defense Labs
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
Scott Helme
Scott Helme
小众软件
小众软件
L
LINUX DO - 最新话题
博客园 - 叶小钗
博客园 - 【当耐特】
PCI Perspectives
PCI Perspectives
SecWiki News
SecWiki News
S
Security Affairs
P
Palo Alto Networks Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
SegmentFault 最新的问题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 聂微东
量子位
C
CXSECURITY Database RSS Feed - CXSecurity.com
Help Net Security
Help Net Security
S
Secure Thoughts
S
Securelist

博客园 - sojay

凡客诚品的跨域获取cookies方法 jquery 飞入购物车效果 SQL2005 中 &quot;SQL_Latin1_General_CP1_CI_AS&quot; 和 &quot;Chinese_PRC_CI_AS&quot; 之间的排序规则冲突 asp.net下载文件的常用方法大全 - sojay - 博客园 IE8下ewebeditor编辑器不能使用的解决办法 - sojay - 博客园 Asp.net SEO优化,针对<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value=""> - sojay 在使用UpdatePanel时JS对话框出错的解决办法。 获取Repeater中Footer/HeaderTemplate 中的控件 用css进行导航定位 导航栏标签定位 - sojay - 博客园 (转)才几百K的eWebEditor v4.6 For asp.net编辑器 各种 Lightbox 效果的实现 XP中IIS“http500”错误的终极解决方法 (原)ASP.NET中的单引号和双引号 - sojay - 博客园 Application, Session, Cookie, Viewstate, Cache对象用法和区别(转) 转载 .NET牛人应该知道些什么?备忘 学习 应用 我的毕业设计 修改MD5加密 提高网站安全 对google个性主页的拖拽效果的js的完整注释
repeater嵌套 - sojay - 博客园
sojay · 2009-04-10 · via 博客园 - sojay

 1    <asp:Repeater ID="repeaterParent" runat="server"  OnItemDataBound="repeaterParent_ItemDataBound">
 2        <ItemTemplate>
 3            <!---------------------------------------------------------------------------------------->
 4            <table width="186" border="1" class="MenuTB">
 5                <tr>
 6                    <th style="cursor:pointer;">
 7                        <img src="images/comments.gif" / alt=""><%#Eval("MenuText"%>
 8                    </th>
 9                </tr>
10                <tr style="display:none">
11                    <td>
12                        <ul>
13                            <asp:Repeater ID="repeaterMinMenu" runat="server">
14                                <ItemTemplate>
15                                    <li>
16                                        <href="<%#Eval("MenuLink") %>" target="frmContent"><%#Eval("MenuText"%></a></li>
17                                </ItemTemplate>
18                            </asp:Repeater>
19                        </ul>
20                    </td>
21                </tr>
22            </table>
23            <!----------------------------------------------------------------------------------------->
24        </ItemTemplate>
25    </asp:Repeater>

C#:

 1        protected void BindParentRepeaterData()//绑定父repeater数据
 2        {
 3            string SqlGetParentMenu = @"SELECT MenuId,MenuText FROM website_Menu WHERE ParentId IS NULL OR ParentId=0";
 4
 5            DataTable dtGetParentMenu = SqlHelper.ExecuteDataset(Configurations.RemoteConnectionString, CommandType.Text, SqlGetParentMenu).Tables[0];
 6
 7            repeaterParent.DataSource = dtGetParentMenu;
 8
 9            repeaterParent.DataBind();
10        }

11
12
13        protected void repeaterParent_ItemDataBound(object sender, RepeaterItemEventArgs e)
14        {
15            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
16            {
17                int MenuId = Convert.ToInt32(((DataRowView)e.Item.DataItem).Row["MenuId"]);
18
19                Repeater repeaterMinMenu = (Repeater)e.Item.FindControl("repeaterMinMenu");
20
21                if (repeaterMinMenu != null)
22                {
23                    string SqlGetMinMenu = string.Format(@"SELECT A.MenuId,A.ParentId,A.MenuText,A.MenuLink   FROM dbo.website_Menu A
24                                                            INNER JOIN dbo.website_RolesMenu B 
25                                                            ON A.MenuId = B.MenuId  AND A.ParentId = {0}
26                                                            INNER JOIN dbo.User_UsersRoles C 
27                                                            ON B.RoleId = C.RoleId AND C.UserId = {1}
28                                                            GROUP BY A.MenuId,A.ParentId,A.MenuText,A.MenuLink ",MenuId,Kuqu.Components.Tickets.UserInfo.Id);
29
30                    DataTable dtGetMinMenu = SqlHelper.ExecuteDataset(Configurations.RemoteConnectionString, CommandType.Text, SqlGetMinMenu).Tables[0];
31
32                    repeaterMinMenu.DataSource = dtGetMinMenu;
33
34                    repeaterMinMenu.DataBind();
35                }

36            }

37        }