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

推荐订阅源

Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
宝玉的分享
宝玉的分享
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
P
Privacy International News Feed
T
Threatpost
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
NISL@THU
NISL@THU
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
Know Your Adversary
Know Your Adversary
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
Intezer
博客园 - Franky
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
The Hacker News
The Hacker News
K
Kaspersky official blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tailwind CSS Blog
Project Zero
Project Zero
T
Tor Project blog
B
Blog RSS Feed
Recorded Future
Recorded Future
Scott Helme
Scott Helme
美团技术团队
V
V2EX
V
Visual Studio Blog
L
Lohrmann on Cybersecurity
P
Proofpoint News Feed
D
DataBreaches.Net
The Register - Security
The Register - Security
M
MIT News - Artificial intelligence
L
LangChain Blog
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园_首页
P
Privacy & Cybersecurity Law Blog

博客园 - Caesar

t-sql中的随机数 服务器应用程序不可用[解决办法] 配置错误:未能使用提供程序“RsaProtectedConfigurationProvider”进行解密。提供程序返回错误信息为: 打不开 RSA 密钥容器。 让指定的按钮获取文本框的回车键 正则表达式的语法表 JS几种常用的表单判断 .aspx中写的Page_Load不执行 安装VS2005 SP1补丁方法(转) 读取Cookie出现乱码的解决办法. 数据库的备份与恢复 ASP.NET基于角色的窗体安全认证机制 用Ajax读取Text格式的数据(转) JQuery参考文档 asp.net过滤HTML标签的几个函数 验证日期的正则表达式 去掉所有HTML标记 将GridView中内容导入到Word asp.net中使用javascript C#文件操作
ASP.NET 嵌套Repeater
Caesar · 2008-01-05 · via 博客园 - Caesar

以下是引用片段:
  -----
Nestedrepeater.aspx

<%@ Page language="c#" Codebehind="NestedRepeater.aspx.cs" AutoEventWireup="false" Inherits="NestedRepeater.NestedRepeater" %>
            <%@ Import Namespace="System.Data" %>
            <html>
            <body>
            <form runat=server>
            <!-- start parent repeater -->
            <asp:repeater id="parentRepeater" runat="server">
            <itemtemplate>
            <b><%# DataBinder.Eval(Container.DataItem,"au_id") %></b><br>
            <!-- start child repeater -->
            <asp:repeater id="childRepeater" datasource='<%# ((DataRowView)Container.DataItem)
            .Row.GetChildRows("myrelation") %>' runat="server">
            <itemtemplate>
            <%# DataBinder.Eval(Container.DataItem, "[\"title_id\"]")%><br>
            </itemtemplate>
            </asp:repeater>
            <!-- end child repeater -->
            </itemtemplate>
            </asp:repeater>
            <!-- end parent repeater -->
            </form>
            </body>
            </html>
            

Nestedrepeater.aspx.cs

using System;
            using System.Data;
            using System.Data.SqlClient;
            using System.Web;
            using System.Web.SessionState;
            using System.Web.UI;
            using System.Web.UI.WebControls;
            namespace NestedRepeater
            {
            public class NestedRepeater : System.Web.UI.Page
            {
            protected System.Web.UI.WebControls.Repeater parentRepeater;
            public NestedRepeater()
            {
            Page.Init += new System.EventHandler(Page_Init);
            }
            public void Page_Load(object sender, EventArgs e)
            {
            //Create the connection and DataAdapter for the Authors table.
            SqlConnection cnn = new SqlConnection("server=(local);database=pubs; Integrated Security=SSPI ;");
            SqlDataAdapter cmd1 = new SqlDataAdapter("select * from authors",cnn);
            //Create and fill the DataSet.
            DataSet ds = new DataSet();
            cmd1.Fill(ds,"authors");
            //Create a second DataAdapter for the Titles table.
            SqlDataAdapter cmd2 = new SqlDataAdapter("select * from titleauthor",cnn);
            cmd2.Fill(ds,"titles");
            //Create the relation bewtween the Authors and Titles tables.
            ds.Relations.Add("myrelation",
            ds.Tables["authors"].Columns["au_id"],
            ds.Tables["titles"].Columns["au_id"]);
            //Bind the Authors table to the parent Repeater control, and call DataBind.
            parentRepeater.DataSource = ds.Tables["authors"];
            Page.DataBind();
            //Close the connection.
            cnn.Close();
            }
            private void Page_Init(object sender, EventArgs e)
            {
            InitializeComponent();
            }
            private void InitializeComponent()
            {
            this.Load += new System.EventHandler(this.Page_Load);
            }
            }
            }