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

web usercontrol as property of other classes possible?

hey there,

i'd like to do some wild thing like this:

imagine a simple page with a navigation menu and an iframe. clicking
on links in the menu loads the according page in the iframe. the menu
is a web-usercontrol of type "MenuList" that uses web-usercontrols of
type "MenuItem" for each link. so far nothing special. but now i'd
like each page that can be loaded to be of an interface/type
"IMenuItem" that publishes a getter for the web-usercontrol of type
"MenuItem", that actually is inserted dynamically into the "MenuList"-
control.
This means ...
1. the page-object has to have a property of type web usercontrol that
is actually not a part of the control-collection of that page.
2. the page itself has to be instanciated somehow to be in some
collection or array of type "IMenuItem[]" in the "MenuList"-control.
are such things by any means possible? i could not figure out how to
do this, and i know how to dynamicaly load controls into other
controls and pages. but that is not what i want here.

why do i wnat to do such a weird thing anyway? the idea emerged out of
the simple wish to encapsulate code into the right classes, instead of
having an additional class that does all the interface-stuff for each
page or control. having the controls as properties in the objects that
own the data would tidy things up very much!

i would apprechiate any replies that either suggest how to do it or
asure me that this is not possible at all with the current concept of
asp.net or suggest a solution that is different but also helps me
straighten the class layout.

thanks in advance,
arthur
Jun 27 '08 #1
0 987

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

Similar topics

7
by: Martin Schulze | last post by:
Hello, i tried to compose myself a custom usercontrol which is derieved from System.Windows.Forms.UserControl. It contains 2 comboboxes and one textbox (which are also custom controls, but...
1
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the...
4
by: Mythran | last post by:
I upgraded a VB.Net 1.1 project to 2.0b2 and now I can't seem to figure out how to fix my user controls. I have a user control named SecurityControl that contains a few static methods and...
5
by: Pieter | last post by:
Hi, I'm getting a really terrible and anoying bug/problem in VS.NET 2005: 1. Create a new Windows Application. 2. Add a new class Class1. 3. Add a usercontrol UserControl1. 4. Add a public...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
2
by: Alex Maghen | last post by:
I want to create a utility function that will seach the current page for one of my UserControls by it's type. So, let's say that I have a UserControl whose class I defined as follows: namespace...
2
by: she_prog | last post by:
I have a class derived from UserControl. I need to serialize an object of this class, but only some properties of it, as not all properties are serializable (some of the properties coming from...
3
by: DougS | last post by:
I have a ASP.Net 1.1 application where I have several usercontrols, one is called DetailLine, that I add to a panel dynamically. I am converting the app to ASP.Net 2.0 and I cant do this anymore....
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.