2

我必须根据条件禁用动态创建的用户控件上的链接。

如何找到控件的类型?我正在使用占位符,因此试图找到如下所示的控件 this.placeholder1.FindControl("usercontrol1").FindControl("div1");

如何在 UserControl1 类型的 usercontrol1 上找到链接?我不能使用 .ascx 文件的名称 UserControl1。

4

1 回答 1

2
  1. 您必须在每次回发时重新创建动态控件。

  2. 然后只有您可以使用这些控件访问这些控件

var yourControll= (UserControlType) this.placeholder1.FindControl("usercontrol1");

于 2015-10-23T22:55:04.150 回答