determining the id of a control

  • Thread starter Thread starter John Slate
  • Start date Start date
J

John Slate

I have a web custom control that loads several other controls
dynamically, in some cases certain controls are not added. I have a
condition where I need to determine the id of a particular control. What
is the best way to determine the id of a control programmatically?
 
Hi John:

Control.ID will give you the ID you would typically see in the aspx
file if the control was added to the page with markup.
Control.ClientID will give you the ID of the control on when it is
sent to the client (if you need to generate JavaScript against the
control).

HTH,
 
Back
Top