G
Guest
Hi -
I am seeing some performance degradation when I am loading a control
dynamically onto a page with multiple other dynamical controls using
Page.LoadControl versus dragging and dropping it onto an individual page.
Page1.aspx.cs
UserControl uc = Page.LoadControl("../UserControls/UserControl1.ascx")
Page2.aspx
<%@ Register TagPrefix="uc1" TagName="UserControl1"
Src="../UserControls/UserControl1.ascx" %>
<HTML>
<HEAD></HEAD>
<BODY>
<form id="StrategicReports" method="post" runat="server">
<uc1:UserControl1 id="UI1" runat="server"></uc1:UserControl1>
</form>
</BODY>
</HTML>
Page2.aspx renders the control much faster than Page1.aspx. Page1.aspx does
do some work in trying to identify which control to load but this still does
not account for the performance hit. Any ideas what is going on here? Is
there some other way to dynamically load the user control, say by adding a
"Reference" in Page1.aspx? Any help will be greatly appreciated.
Thanks in advance.
Kan
I am seeing some performance degradation when I am loading a control
dynamically onto a page with multiple other dynamical controls using
Page.LoadControl versus dragging and dropping it onto an individual page.
Page1.aspx.cs
UserControl uc = Page.LoadControl("../UserControls/UserControl1.ascx")
Page2.aspx
<%@ Register TagPrefix="uc1" TagName="UserControl1"
Src="../UserControls/UserControl1.ascx" %>
<HTML>
<HEAD></HEAD>
<BODY>
<form id="StrategicReports" method="post" runat="server">
<uc1:UserControl1 id="UI1" runat="server"></uc1:UserControl1>
</form>
</BODY>
</HTML>
Page2.aspx renders the control much faster than Page1.aspx. Page1.aspx does
do some work in trying to identify which control to load but this still does
not account for the performance hit. Any ideas what is going on here? Is
there some other way to dynamically load the user control, say by adding a
"Reference" in Page1.aspx? Any help will be greatly appreciated.
Thanks in advance.
Kan