User Control Loads many Times
I am using a control and on its page load event I am performing some task. But When I debug and analyse it then I found some drastic performance issue.
Control is on Mater page. When I load home page inherited from master page then controls load once so far so good, but when I go to some inner page then control loads many times. e.g link below cause control to loads 4 times because the url having 4 levels(/).
Can you tell me why is it happening ? Any workaround?
I tried to reproduce your problem, but I couldn't. I created master page with custom control on it, then created a page ( named "page" ), based on this master page. I made this page to not be homepage. Then I created 3 parent pages for this page in hierarchy. When I loaded the "page" named page, the control's Page_Load was called only 1 time.
Can you give me some specific instructions how to reproduce this, or send me your DB, config files and any custom data that I need.
the Telerik team
I am having the same issue; When I run my control in a standard aspx page. The control is called 1x(life cycle). While I am in Sitefity 4.x; the control is called 4x exactly. So any variables I set during the original page are load are reset during each load.
Has anybody else had this problem; You can not see it unless you run the sitefinity site in debug mode.
-doug lubey of louisiana
Search engine reference:
sitefinity control is called multiple times during pageload
I found out why this occurs inside my code: I use a RE-ROUTING TECHNIQUE (or really a url interception) to route my page to the proper telerik virtual path.
THE CMS wanted to reload the page for every js file;
Please see this url for more information:
OK found a bug in the above code: The Page_load event would execute multiple times. Why; becuase every js and css file which was used on the master page was considered in the process. So for a given page; this means if thier is 10 js files; this code would be called 11x times. LIKE I SAID ABOVE; TELERIK WOULD BE NICE IF THEY CHIMED IN AND TOLD US HOW TO REALLY DO RE-ROUTING INSIDE THEIR FRAMEWORK.