c# - 我的 ASP 控件 ID 没有出现在页面后面的代码中 (C#) 如何解决这个错误?
问题描述
即使我一次又一次地重建解决方案,我的 ASP 控件 ID 也没有显示在页面后面的代码 (C#) 中。ASP 的第一行开头是:
有蓝色下划线。我正在提供此错误的图片。请帮助我解决这个问题。谢谢
解决方案
你可以试试这个:
foreach (Control panelctrl in UpdatePanel1.ContentTemplateContainer.Controls)
{
if (panelctrl is Panel)
{
Panel p = (Panel)panelctrl;
foreach (Control txt in p.Controls)
{
if (txt is TextBox)
{
TextBox txtBox = (TextBox)txt;
// do something with textbox
}
}
}
}
推荐阅读
- r - 仅对列表中的数字部分求和
- azure-devops - Synapse - 无法正确部署 SQL 链接服务器
- java - 连接本地主机失败(桌面)
- python-3.x - dagster - 错误 - train_pipeline | S3 URI AWS
- css - 使用纯 CSS 的简单倒计时圆形动画
- python - 项目问题,求图片处理方面的建议
- css - 自定义 div 形状 CSS?
- python - 没有连接到 MariaDB
- mongodb - 根据MongoDB聚合中的数组排序
- azure - 有没有办法在 azure 函数应用程序中使用 terraform 创建 HTTPtriggers