开发者

ASPX Control Injected Access

开发者 https://www.devze.com 2023-03-11 14:07 出处:网络
I have a situation where I add several controls at runtime.I do: placeholder.Controls.Add(theaddedcontrol);

I have a situation where I add several controls at runtime. I do:

placeholder.Controls.Add(theaddedcontrol);

开发者_JAVA技巧When I collect input from the page, I do not know how to access the added controls for their values.

Any suggestions?


Use the following structure:

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

Refer to Control.FindControl Method


You'll need to use the Control.FindControl method.

You can find more information on how to use this over at MSDN

0

精彩评论

暂无评论...
验证码 换一张
取 消