Web page .aspx is slow when loading. Pages have web user controls on them that are loaded dynamically

I have written a web application using VS 2003. Several of my forms have web user controls on them. The controls are loaded dynamically at runtime. The problem is that the web pages are very slow to load. Does anyone know if there is a way to speed up the pages being loaded into the browser? Here is an example of some code I use to dynamically load the controls:

 private void Page_Load(object sender, System.EventArgs e)
   // Put user code to initialize the page here
   // Put user code to initialize the page here

   Control marketWebUserControl = Page.LoadControl("Market.ascx");
   // Typecast the user control to the strong name
   // And set its properties

   //((Market)c).BackColor = Color.Beige;

11/9/2006 9:35:26 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 5
Get it on Google Play
Get it on Apple App Store

Honestly it all depends what your controls are page is doing.... Some general hints is to remove viewstate if possible and second check the size of the page that's being created in html.... By viewing the source and saving that text file, you could be amazed at the size...

 Another idea would be to trace your page and see what's killing the load time.. To do this simply add Trace=True in your <@ Page declarative. on the aspx page.


11/9/2006 11:35:14 PM
Oh one more thing.... Instead of dynamically adding your controls if it's not necessary i would suggest just writing them up in the aspx scripting..... to do this i would recommened doing the following:


<%@ Register TagPrefix="CC" TagName="ControlName" Src="~/Controls/ControlSource.ascx" %>|

This gives you the ability to then add the controls like so..

<CC:ControlName runat="server" ID="MyControl"/>

Just an idea..
11/9/2006 11:37:16 PM

Similar Artilces:

Web page is slow to load, using several different web user controls?
I have a web form that uses three user controls. When the page loads it is so slow, taking several seconds to load the other controls. Does anyone know how I might fix this? Here is the main .aspx page that has the controls.  <%@ Page language="c#" Codebehind="DocList.aspx.cs" AutoEventWireup="false" Inherits="DocumentMgmt.DocList" %> <%@ Register Src="Controls/DesktopPortalBanner.ascx" TagName="DesktopPortalBanner" TagPrefix="uc2" %> <%@ Register Src="Controls/DocMgmtStandard.ascx" TagPre...

Web Menus / User controls in aspx web page and .aspx C# based web templates
Dear all, I have created several user controls and included in the webpages. (This user control is a navigation menu consisting of images) This has to be included in all webpages. But when i tried to publish i get error messages for them. But i can’t remove since i need these user controls. Error message given below Error 2 The type 'WebUserControl' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\new_latest\d203e69a\d67c356f\App_Web_ijsq-eqk.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\new_la...

Load Web User Control on Page Load
I have a web page, with a header and footer web control and it all works great. What i want to do is load a web user control on load of the page. Let me explain a little more. If i have a links page (links.aspx) with 3 web user controls. header.ascx, footer.ascx, and link.ascx. When i click on a link thats contained in the link.ascx i want to use the same links.aspx (mostly for the header and footer controls) but i want to load another web user control in the same spot where the old link.ascx is. Is this possible? Thanks!.. :: kleptos :: .. <%@ Page %> <%@ Regist...

Web user control loading if page is been loaded
I have a User Web control with a updatepanel. The user webcontrol does take some time to load, so I want to wait with loading the User Webcontrol Till the page is been loaded and showed to the user. How can I make do this ? This example explains about on demand UI loading. I think this is what you are looking for http://msmvps.com/blogs/omar/archive/2007/11/09/on-demand-ui-loading-on-ajax-websites.aspx  http://devarchive.net/loading_user_controls_using_with_page_methods.aspx (Loading User Controls Using ASP.NET AJAX Page Methods ) http://forums.as...

Single page with multiple user web controls VS Multiple page with specific user web controls
I have a question regarding single page with multiple user web controls vs multiple page with specific user web controls   Option 1: I am of the opinion to have multiple pages with specific user web controls and use an object to store all the information as the user navigates through the application. And finally at the end, read this object and save all the information to the backend database.   Option 2: My respected team member suggests that we have only one page, with all the specific user web controls and not use an object, instead show/hide the user web controls based ...

How can I control load sequence of web controls in a web page?
Hi, How can I control load sequence of web controls in a web page? Thanks. For the most part, the load sequence on a web page is not relevant since all controls must be present before the page can be used. Could you provide more information as to what you're trying to do?Christopher Reed"The oxen are slow, but the earth is patient." Hi, As far as I know, we have no luck to control the load order of the Web controls on a page. However, if we need to load some controls under given conditions, we can achieve this by adding them dynamically instead.Forwa...

To access a control placed in a web user control which is loaded during page load in button click event
How can I access a control in a web user control in a button click event , the user control is loaded in page load.Thanks & Regards,Abhiram Reddy Mekha. Try checking this... http://microsoft.apress.com/asptodayarchive/73869/event-handling-between-custom-user-controls-that-are-loaded-at-run-time http://aspalliance.com/565_Dynamic_Loading_of_ASPNET_User_Controls http://www.beansoftware.com/ASP.NET-Tutorials/Controls-Run-Time.aspx http://stackoverflow.com/questions/92792/user-control-created-dynamically-not-able-to-handle-events-on-postback http://www.codersource.net/asp_net_user_c...

User Controls loading on a web tab every page load
I have user controls loading every single time I run a page load.  I was wondering if anybody had any ideas for dynamically loading these controls? I can achieve this but with my web tab that I currently have my tabClick event comes back on the page load and I would need to know the the selected tab before initialization of the page in order to keep the controls persistence.  Any ideas would be greatly appreciated.  I have about exhaust all possibilities with this one. Add the controls to the page in Page_Init event. And everything should work fine. Dynamically added control...

Dynamically load and uload user controls to web page
Hi In my web site I have one web page.Im dynamically load user controls(.ascx) files to that page.In my .ascx page i want to do some validation when it loads and unloads.When I double click on the .ascx in design view its automatically genarated Page_Load event and works fine.But I cant get Page_Unload in .ascx file.How can I do that?Please help.   Thank you Pubudu  Hey, You can override the OnUnload method to do that:  protected override void OnUnload(EventArgs e) {}Brian"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in...

web parts(user control) clear automaticaly when page is binded in page load
Hi to all,          I am having a webpartzone, user controls are added to thatin  page load event as follows                 Dim uc As Control = Me.LoadControl(strcontrol)                uc.ID = panel.PanelID                Dim gp As GenericWebPart = MainWebPartManager.CreateWebPart(uc)      &nb...

Debugging exception when loading a web page in the Web Forms Designer
In a project at work I have inherited, I am getting an exception when loading an .aspx page in the Web Forms designer. The project was originally created with VS .NET 2002 and I am upgrading it to VS .NET 2003. It appears that the Web Forms designer actually attempts to instantiating an instance of the codebehind class in order to bring ou the Web Forms designer page. Why does it do this ?The codebehind class inherits from another class, which inherits from System.Web.UI.Page. It is in this other class in which the exception is occurring.Is there any way I can debug this so that I can find o...

Can my web page with a form submit to other web pages forms?
I was wondering if I created an aspx page that had a form on it that I could use the submit button to submit this form's contents to other web pages forms(servers accepting those form's data). I am thinking this would be a great way to update data on particular web pages without having to actually visit those similar web pages. Any ideas, examples would be much appreciated. Thanks in advance.  Yes you can.  It's called Cross Page Posting: http://msdn2.microsoft.com/en-us/library/ms178139.aspxAlso: http://msdn2.microsoft.com/en-us/library/ms178140.aspx might ...

How to store in a web page dynamic data in a web Page ?
Hi,I have 1 ListBox containing :1 ~ MACHINE A ~ 0 ~ 23 ~ R2 ~ MACHINE B ~ 4 ~ 477 ~ R3 ~ MACHINE C ~ 2 ~ 78~ R4 ~ MACHINE D ~ 9 ~ 76~ TI should have :1 ~ MACHINE A2 ~ MACHINE B3 ~ MACHINE C4 ~ MACHINE DThis ListBox is populated by a DataBase => So the line numbers isn't known for advance.How to store in ASP.NET these values (0, 23, 4, ...) ? I need these values into the web page because I need them for JavaScrip functions. Do List like HiddenFields exist ?Thanks for your tips.David. i am bit confused by your question.. can you explain it once more"Mark as ...

how to open a web page in form of a popup web page
Hello, I have two web pages, let say. Page A : With a Button on it. PAge B: with some info. Now I need to: When I click on the Button of page A.Page B must open in a pop up window.  I can do this but problem is this when I clicked on the button for first time it does not show me any thing and when I clicked on the button for second time then It shows me Page B .My code is as follow:  1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!this.Page.IsPostBack) 4 { 5 6 } 7 else 8...

Web resources about - Web page .aspx is slow when loading. Pages have web user controls on them that are loaded dynamically - asp.net.web-forms

Placebase team at Apple file “Schematic Maps” patent dynamically detailing important data
In a report from Computerworld way back in 2009, we learned that Apple had quietly acquired Maps API company Placebase. Then, founder of Placebase ...

Apple's Lightning port dynamically assigns pins to allow for reversible use
... a closer look at how Apple's new Lightning connector works, and has come to the conclusion that the 8 pins on each side of the plug are dynamically ...

In a dynamically typed language, is it a bad idea to return different data types?
In some cases, returning different types from a single function works.

Urlbox Launches Screenshots-as-a-Service Platform to Dynamically Update Galleries
... changes. Launched yesterday, Urlbox allows anyone with a gallery displaying website screenshots to automate the process and keep them dynamically ...

Everything.me launcher dynamically adapts to what you’re doing right now
... phone according to what you’re doing. Perform a search for ‘football’ and your background will change to the NFL logo. A launcher that dynamically ...

A YouTube Experiment Resizes the Player Dynamically
There's a new YouTube experiment that changes the video player's size, depending on the browser window's size. When resizing Chrome's window, ...

Apple Granted “Dynamically Changing Cursor for User Interface” Patent, Originally Filed in 2003
... a utility patent that covers the use of the mouse cursor that changes according to the context of the task it is engaged in. Called a “Dynamically ...

Atmel's FPSLIC II Dynamically Reconfigurable SoC Supports "Silicon-Sharing" For Peripherals & Interfaces ...
Silicon-Sharing Fits 200K Gate Design into 40K Gate FPSLIC II's, Cuts Power Drain by 97%

Everything.me Launcher Wants to Dynamically Change Phones Based on Location, Interests, and Mental State ...
What if your phone’s launcher dynamically changed based upon interests, your location, or topics you had in mind at a specific moment? A new ...

Resources last updated: 1/16/2016 5:57:47 PM