gpt4 book ai didi

asp.net - 获取 .NET 中特定 div 内的控件列表

转载 作者:太空宇宙 更新时间:2023-11-04 14:48:30 24 4
gpt4 key购买 nike

如何在 ASP.NET 中获取特定 div 中的控件列表

最佳答案

假设你的 div 有一个 ID 属性(比如说你的 Div)和 runat="server",并且假设你使用的是 C#,试试:

    for (int i = 0; i < yourDiv.Controls.Count; i++)
{
Console.WriteLine(yourDiv.Controls[i].ToString());
}

列出 div 中包含的控件的类型。

关于asp.net - 获取 .NET 中特定 div 内的控件列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3748979/

24 4 0
文章推荐: javascript - JQuery 日期选择器不工作
文章推荐: java - 在版本 :prepare only 上运行 Maven 配置文件
文章推荐: java - 葫芦-android : Touch fails due to "No elements found" but element was found
文章推荐: html - 我需要一个带有禁用元素的 HTML