473,386 Members | 1,823 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,386 software developers and data experts.

Any way to access child controls of server control?

Is there a way to compile a user control into a redistributable
assembly [i.e. server control], but still have access to its child
controls using the .Controls property?

Here's what I mean:

I have a user control that contains some child controls, mostly custom
text boxes and such. If I load this control declaratively or using
LoadControl(), I can access those child controls using the .Controls
property.

However, I need this control to be redistributable, ideally as a .dll.
I found a blog post [http://blogs.msdn.com/davidebb/archive/
2005/10/30/487160.aspx] that explains how the user control can be
compiled into an assembly that can then be used just like a server
control.

That technique works fine, except that when I load the control I can
no longer iterate those child controls; the .Controls property returns
an empty collection.

Anyone have any suggestions?

Thanks so much in advance,
Seth Petry-Johnson

Mar 26 '07 #1
1 1721
Is there a way to compile a user control into a redistributable
assembly [i.e. server control], but still have access to its child
controls using the .Controls property?
Nevermind, answered my own question. I was loading the compiled
control using its constructor, not LoadControl(). When I used
LoadControl(typeof(mycontrol), null) it works fine.
Mar 26 '07 #2

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

Similar topics

2
by: wASP | last post by:
Hi, I was under the impression that, when ASP rendered a page, it recursively traversed the hierarchy, executing all controls in each ControlCollection of every control in that hierarchy. I...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
3
by: Arulraja | last post by:
Hello, I have created 2 custom server controls, The parent custom control contains multiple child custom controls. The Child control has a button on it. If I Click the button control, it...
0
by: bill yeager | last post by:
I have a datalist displaying parent information and a datagrid presenting child information. The data is being rendered just fine. The datagrid has template columns on it that I cannot gain access...
1
by: bill yeager | last post by:
I did some more debugging and found the following: 1) I placed the following code in the button event just to see if I could cycle thru the datagrid control collection: <code> Dim strhello As...
2
by: Dmitriy Zakharov | last post by:
Hi, I'm trying to create a control that contains other controls. But the problem is that child controls are treated as properties, and page could not be parsed. Parser Error Message: Type...
1
by: Aquila Deus | last post by:
Hi all! Following is the method I use to insert child controls into user controls, so that you may use them just like ordinary custom controls: ...
2
by: Chris | last post by:
I have created a date picker user control. I want to have a boolean property, which I can set to determine whether the control defaults to today's date. I have created a property which I set to...
5
by: gerry | last post by:
I am trying to create a custom container control that will only ever contain a specific type of control. At design time, when a control of a different type is added to the container I would like...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.