Placeholder issue

  • Thread starter Thread starter tma
  • Start date Start date
T

tma

How do I reference controls added via the placeholder control in my
codebehind file?

For example, my placeholder adds a checkbox with an id="chkGear". How do I
test for the checkstate of chkgear in code?

Thanks!
 
How do I reference controls added via the placeholder control in my
codebehind file?

For example, my placeholder adds a checkbox with an id="chkGear". How
do I test for the checkstate of chkgear in code?


Use the FindControl method to get a reference to the control.
 
Hi tma,

If you are dynamically creating and adding those controls, you should
store a reference to them in a class field, where you will find the
other ASP.NET controls.
 
Back
Top