Performance problem and probable relation to user control inheritance

31 views Asked by At

I implemented a web application using web form technology. The problem is that the page takes too much time to load. I used user controls for different parts of the page. After measuring the time elapsed for each part I realized that for each user control it takes about 10 seconds from Page_Load to Page_PreRender. This shows that all user controls are equally slow. I searched for some common time-consuming operation in the user controls but I didn't find any. But the only common fact is that I didn't derive these user controls directly from the UserControl class. Instead, I wrote a class namely GenericUserControl that is derived from UserControl class and I put some shared fields required by all user controls (not any operation) then I extended the other user controls from this generic class. I ask if it is possible that this causes the performance problem?

1

There are 1 answers

0
Yaghoob Koleini On

I removed all inheritances so that the user controls are inherited directly from the UserControl class and surprisingly the performance problem is resolved completely.