0

Possible Duplicate:
Better way to find control in ASP.NET

Hi,

Is there any way to refactor this:

placeholder1.Controls[0].Controls[0].Controls[0].Controls[0].Controls[1].Controls[1].Controls[1].ClientID.ToString();

Thanks

Community
  • 1
  • 1
Bart
  • 4,830
  • 16
  • 48
  • 68
  • 2
    Some more detail as to what you are doing would be helpful - this seems like a horrible way to get the ClientID – Prescott May 03 '11 at 00:40

1 Answers1

0

Are those controls created dynamically? If not, you can just specify the control you want by whatever you named it. WhatYouNamedIt.ClientID.ToString()

CheckRaise
  • 550
  • 2
  • 16