I am exploring an asp.net web application that makes extensive use of user controls on every page. Most pages contain about 10-20 user controls. User controls appear to be a visual representation of business objects (if that makes sense), albeit with finer granularity, such as each tab of a tab control that has its contents in a user control. The project itself contains more than 200 user controls (ascx files).
Application performance is very low (and the reason I'm investigating). For each event (for example, to select a click or drop-down menu, etc.), it takes about 5 seconds to load the page (10 seconds in the visual studio). The application does not use Ajax.
Tracing is painful because the aspx pages themselves do not have code in the code, because the user controls all of this, so tracing instructions on all the user controls on that page are required to track one page.
I actually think that every user control of his business code and its reuse is a smart idea, but overuse of user controls will lead to performance hit? Does this look like the structure of an asp.net application written by someone with a strong WinForms background?
EDIT
I thought I should add that I will not doubt the use of user controls (or even amounts), but simply because there is so much on the page that everything performs (each user control is connected to a database, for example) usually cause performance problems ... For example, if only one user postback control does something, and with regard to processing all the others, some of them are visible and some are not ... @ David Macewing mentioned that he would Lo 40 optimized user controls that perform, etc. but if the developer was based on WinForms or "not familiar with asp.net," then how are they going to make sure that each of them is optimized ...
EDIT2
After receiving a trace of the sql operator, the same data calls are performed 5-6 times per page for each event, since different user controls require data that is not usually stored, for example. each user control in the tab (mentioned above) makes the same call to populate an object from the database ... I'm really not here to blame the user controls for the problem (should I delete the question?), how clear is the problem these are NOT user controls, but with their use in this particular case ... which, in my opinion, is excessive!
davidsleeps
source share