Blog Stats
  • Posts - 178
  • Articles - 0
  • Comments - 61
  • Trackbacks - 234

 

Server Control Development Tip #5: Do You Need INamingContainer?

Most server controls will need to implement INamingContainer but if you need to do a quick test, try this on for size:

1.   Does your control provide data binding?
2.   Is your control a templated control.
3.   Does your control have child controls that may need to have events re-routed to them?

If you answered yes to any of these three questions, you need INamingContainer.
Most of the heavy controls (by heavy I mean flexible and reusable, not bloated) use INamingContainer including the DataGrid and DataList. The major use of INamingContainer is that it creates a new ID namespace in the Page object's control hierarchy. In other words, if you develop a server control that implements the INamingContainer interface, you can refer to your control's child controls by yourControl_uniqueControlId.

Feedback

No comments posted yet.


Post a comment





 

Please add 8 and 7 and type the answer here:

 

 

Copyright © Jason Bentley