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

推荐订阅源

S
Securelist
O
OpenAI News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Google Online Security Blog
Google Online Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
N
News and Events Feed by Topic
S
Security Affairs
SecWiki News
SecWiki News
Project Zero
Project Zero
L
Lohrmann on Cybersecurity
P
Proofpoint News Feed
P
Palo Alto Networks Blog
L
LINUX DO - 最新话题
H
Hacker News: Front Page
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
K
Kaspersky official blog
The GitHub Blog
The GitHub Blog
I
InfoQ
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
B
Blog
IT之家
IT之家
AWS News Blog
AWS News Blog
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
Spread Privacy
Spread Privacy
N
News and Events Feed by Topic
Security Latest
Security Latest
美团技术团队
C
Check Point Blog
WordPress大学
WordPress大学
T
Tenable Blog
S
Security @ Cisco Blogs
Last Week in AI
Last Week in AI
博客园 - 聂微东
月光博客
月光博客
博客园 - 【当耐特】
S
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Secure Thoughts
Schneier on Security
Schneier on Security
C
Cisco Blogs
Cyberwarzone
Cyberwarzone

博客园 - Class Xman

手动建库时一个小错误:ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance Windows下USB磁盘开发系列二:枚举系统中所有USB设备 Clouda聊天室实践 浅说正则——会了就不会忘 android开发中难免遇到listview刷新数据出现异常 hdu2068RPG的错排 用实例讲解RSA加密算法(精) ARM——操作系统—最小操作系统-开发板测试 HTML入门教程 HDU 4770 Lights Against DudelyLights (顺序表的应用5.4.3)POJ 1012(约瑟夫环问题——保证前k个出队元素为后k个元素) Android 程序崩溃后的处理 IE7 float:left失效的解决方法 android实现通过浏览器点击链接打开本地应用(APP)并拿到浏览器传递的数据 如何避免来自企业内部的网络安全威胁(二) Android安装失败 Installation error code: -110 Android TextWatcher监控EditText中的输入内容并限制其输入字符个数 不让自己的应用程序在桌面的图标列表里启动显示的方法 Fragment与FragmentAcitvity间的传值
ASP.NET Repeater嵌套Repeater实现菜单加载
Class Xman · 2013-11-14 · via 博客园 - Class Xman

            在KS系统中要实现从数据库中读取界面权限文件实现菜单、界面的动态加载。

            效果图:

                

            ASP.NET界面代码

   <div id="menu-container">
                <asp:Repeater ID="rpMenu" runat="server" onitemdatabound="rpMenu_ItemDataBound">
                  <ItemTemplate>
                    <div class="menu-tit" id="MenuName">
                        <asp:HiddenField ID="hfMenuID" runat="server"  Value='<%#Eval("Id") %>' />
                        <%#Eval("MenuName") %></div>
                        <div class="menu-list">     
                        <div class="top-line"> 
                        </div>          
                      <ul class="nav-items">
                          <asp:Repeater ID="rpWindows" runat="server">
                             <ItemTemplate>
                                <li><a href='<%#Eval("WindowsURL") %>' target="content" id="WindwosName"><%#Eval("WindowsName") %></a></li>
                              </ItemTemplate>  
                         </asp:Repeater>
                        </ul>  
                    </div>   
                     
                  </ItemTemplate>
                </asp:Repeater>
            </div>

            C#界面后台代码

 public partial class AdmWelcom : System.Web.UI.Page
    {
     
        protected void Page_Load(object sender, EventArgs e)
        {    
            string strLike="";
            DataBindMenu(strLike);
        }

        public void DataBindMenu(string strLike)
        {
            DataTable dtMenu= new DataTable();  
            AdmMenuManager admMenuManager = new AdmMenuManager();
            //查询菜单
            dtMenu = admMenuManager.QueryMenu(strLike);
            rpMenu.DataSource =dtMenu;
            rpMenu.DataBind();    
        }

        protected void rpMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater rpWindows = e.Item.FindControl("rpWindows") as Repeater;
                HiddenField hfMenuID=e.Item .FindControl ("hfMenuID") as HiddenField;
                DataTable dt = new DataTable();
                string strLike = "";
                BLL.AdmMenuManager admMenuManager = new AdmMenuManager();
                string strMenuID = hfMenuID.Value.ToString().Trim() ;
                strLike = " TR_MenuWindows.MenuID='" + strMenuID + "'";
               //查询界面下的窗体
                dt = admMenuManager.QueryMenuWindows(strLike); 
                rpWindows.DataSource = dt;
                rpWindows.DataBind();
             
            }
        }
    }