chalamarc: i think using of findcontrol() on your formview or anyother control name, it is the best way as you neednot to actually go down on your performance and also you can get rid of all the code that has been shown on the top and one which make full use of the api's and its functions which microsoft provides.
If that were a valid argument, we would still be coding in COBOL and FORTRAN, or maybe 1s and 0s. :)
Computer Science is the science of giving away something you want to get something else you want more.
Which route to use is simply a matter of priorities. The recursive (or iterative) versions of FindControl provide the following benefits and drawbacks:
- Runtime Performance
+ Codetime Performance (it's faster and more convenient for the programmer!)
+ Robustness when the number of levels in the UI Layer changes
+ Easier code to read.
Hard-wiring the reference by nesting chaining FindControl methods offers the following benefits and drawbacks:
+ Runtime Performance
- Codetime Performance
- Robustness
- Harder to read.
Pick the method that best meets your needs.
If this answered your question, be sure to mark it as the answer. That way, everybody after you will know it's the answer also!