473,511 Members | 16,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recursive User Controls?

Is it possible for a user control to contain instances of itself? i.e. for a
TreeView-style control.

When I try it, I get a Parser error: "Circular file references are not
allowed."

Thanks!!
Michael Carr
Nov 18 '05 #1
2 2768
A user control, fundamentally, is a class. A class is able to hold a
reference to another instance of the same class, which is exactly how you
would implement a linked list. However, you would not want to put in a
reference to the same instance of that class, for this would be a circular
reference. This is the first thing to check.

To be honest, I don't know specifically about a user control, because this
is not the design that I would use. A user control is the mechanism by which
you implement the aggregator design pattern. It is very useful if you want
to encapsulate a collection of controls as a stand-alone reusable entity. If
you are attempting to make a single control - a tree-view-style control - a
better design choice would be to create a custom server control.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Michael Carr" <mc***@umich.edu> wrote in message
news:eA**************@TK2MSFTNGP09.phx.gbl...
Is it possible for a user control to contain instances of itself? i.e. for
a
TreeView-style control.

When I try it, I get a Parser error: "Circular file references are not
allowed."

Thanks!!
Michael Carr

Nov 18 '05 #2
Check to make sure you are not creating a circular inheritence hierarchy. For Example: C extends B extends A extends C.
Nov 18 '05 #3

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

Similar topics

0
1736
by: Kate | last post by:
Hi: Well, I finally jumped into User Controls and am immediately over my head. I have gone through the Help file pages and tutorials completely, getting a vague feeling what I want to do is...
10
2685
by: BBM | last post by:
Hi, I have been developing with C# User Controls and occasionally have a problem where I "lose" a control from the design surface of the User Control. The controls that I am using to build my...
1
2116
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new...
6
8883
by: TomislaW | last post by:
How to find all user controls (ascx) loaded on a Page?
0
2265
by: jonelling | last post by:
I am having a problem where the page load event is not being fired for certain user controls that I load dynamically in placeholders. Here is what I'm doing in brief, with full test code supplied...
1
2229
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
1
1497
by: npverni | last post by:
I have a fairly complex form that needs to load and maintain the state of several different dynamic user controls. Here is the workflow: 1) A series of editable user controls (each containing...
8
3157
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
2
1716
by: aarf | last post by:
Does anyone have an opinion or fact if nested user controls are a best practice, especially if you want performance from the page? I've seen pages that nest about 4 levels of user controls. ...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
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...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.