473,378 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

this.Controls.Add()

I am developing a series of custom controls which get
added to a parent aspx container using the instruction
this.Controls.Add( myControl ). The parent application
creates an html table dynamically, and for each table row,
adds upwards of seven custom controls per row, which are
initially hidden. Custom controls are displayed based on
buttons the user clicks on a given row. When the
application processes renders table rows in an amount
greater than thirty, the application takes over 30 seconds
to render the entire page. We have used .NET profiler and
have determined the instruction this.Controls.Add(
myCustomControl ) is where execution time is being
consumed. My custom controls are simply c-sharp classes
with a Page_Load handler. These custom classes in turn
render a series of web-based .NET controls.

Why is the instruction this.Controls.Add() performing
slow? I have 1 gig of memory on my workstation.

Steve
Nov 17 '05 #1
3 2740
Hi Steve,

Did this problem occur with a particualr custom control? For example, when
you add it with this.Controls.Add, it run slowly? If you add 30 same custom
controls, will this problem also occur?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #2
Hi Luke,

Nope. The problem is apparent with all custom controls
added I've implemented. There are three main
this.Controls.Add( myControl ) calls in the top level
page_load. These calls are executed for each table row
rendered. There are thirty table rows in all. Each of the
custom controls added, may in turn nest other custom
controls which are added using this.Controls.Add(
myControl2 ). The .Net profiler has determined that these
calls are suspect and responsible for most of the
execution time. Ultimately the custom controls are
rendering a series of web controls. Now all of the custom
controls have a page_load event which gets called when the
control is added (i.e this.Controls.Add() ). Can I send
you an attachment of a sample custom control? How would I
direct an e-mail of this type using the web-client.

Steve Gagliardo
-----Original Message-----
Hi Steve,

Did this problem occur with a particualr custom control? For example, whenyou add it with this.Controls.Add, it run slowly? If you add 30 same customcontrols, will this problem also occur?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers norights.)

.

Nov 17 '05 #3
Hi Steve,

With web-client, it is not be able to attach such a big project. To protect
your private code, I recommend you may submit a technial support incodent
for this issue. I think we need to analyst the source code of your custom
web control to find the problem. With a support incodent, this issue may be
resoved in a timely way. For detail, you may browse to:
support.microsoft.com.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rafi | last post by:
Hi, In my database I have table category where I store diffrent categories and subcategories. I decied to create LinkButtons dinamically with assigned name of category and its id. I also...
13
by: Chris Thunell | last post by:
I have created several grids dynamically and have added them to different HTML placeholders on a vb.net web form. The grids and controls within them come up and view beautifully when the web page...
6
by: Roy | last post by:
Hey all, I'm a relative newcomer to asp.net and have 2 simple code snippets below. Everything works fine, I'm just curious if there is a more efficient way to do the job as the update takes quite a...
3
by: RN | last post by:
I have a table cell in which I add a few things, but I want a few HTML line breaks (the <BR> tag) to separate these things. Sounds simple but I can't get it to work. Dim litBR as New Literal...
5
by: Just Me | last post by:
Given a button name Btn_5 and Index=5 I want to do something like dim zz as string = Btn_??Index??.Text or given an array of buttons, do:
3
by: RallyDSM | last post by:
Pre STory - I've had a lot of problems with this program, and I just added the last part of it (the add item code) and now an older part of the program crashes. Public Structure Stocks Public...
2
by: Hellogeetu | last post by:
Hi All, I am creating dynamic controls but not on page_load event but on one of the button click event. I m able to get the controls value by using request.form but i m unable to handle the...
7
by: Matt | last post by:
Hi all, I'm trying to create a system where it reads a number of records from a database and then creates a row in the GUI that contains a single field from the database and a button that has a...
2
JimWu
by: JimWu | last post by:
Do anyone know how to layout in Panel control. The code as follows labels.Text = "Album Name :"; labels.Text = "Title :"; labels.Text = "Tag :"; labels.Text = "Description :";
0
by: creejohn | last post by:
Hi all-- I'm really stumped here. I have a (c# 2.0) calendar control that loads a menu for each day inside the cell corresponding to that day in the dayrender event. That is all working great. I...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.