2011-06-04 65 views
0

我有一种情况,我在运行时添加了几个控件。我这样做:ASPX控制注入访问

placeholder.Controls.Add(theaddedcontrol); 

当我从页面收集输入时,我不知道如何访问为它们的值添加控件。

有什么建议吗?

+0

这种过度的更多信息)传递ID控制的? – 2011-06-04 22:08:11

回答

1

使用以下结构

Control control = (Control) placeHolder.FindControl("ControlName"); 
Object targetProperty = control.//Target Property ... 

参考Control.FindControl Method

0

你需要使用Control.FindControl方法。

你可以找到如何你有没有尝试placeholder.FindControl(使用在MSDN