Thursday, December 18, 2008

Registering UserControl in web.config

User controls are quite commonly used in our asp.net pages. The purpose of that is mainly, code ones and use in many pages. Of course, the page should be decorated with @Register directive pointing that usercontrol location. Say, if the name of the usercontrol is changed, then it has to be changed in as many pages it has been decorated and it becomes bit complex.

But declaring usercontrol in web.config avoids declaring in .aspx pages therby avoiding decoration @Register directive in many .aspx pages.

Registering in web.config is shown below-


Using the Usercontrol registered in web.config

0 comments: