473,386 Members | 1,720 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.

User control design question

Hi all,

I have a dashboard page that hosts several sections. Each section can have different modes (Ex: preview mode, edit mode etc) and one of the differences between the modes are how they are rendered.
I plan to implement these sections as user controls. I will expose a property in the UC that defines the mode. I will need need some way of having the user control behave in a different way and render layout differently.

Question:

1. From the architecture perspective, would it be more efficient if I simply have different user controls for different modes?

2. If I go with a single UC, I can have panels that I hide/show based on the mode. I can then define a base class for each UC and create subclasses (that represents different modes) that derive from this class. This would be similar to a strategy design pattern.


Is there a better design? Thoughts?
Nov 15 '08 #1
1 1019
tlhintoq
3,525 Expert 2GB
Personally I like the idea of a single control for each type, and have that control smart enough to handle the mode its in.

That way you avoid:
- Speedometer-Basic
- Speedometer-Intermediate
- Speedometer-Advanced

and so on.

I would think it much cleaner to just have a single "Speedometer" control that takes a parameter of "mode" on creation.

If you also react to a mode change then the same control already in place can change from "basic" mode to "advanced" mode when a different user logs in.

You could also have a mix of modes depending on the user. Maybe Bob is allowed to see the advanced mode of the Speedometer control, but only the basic mode of the Preferences control because he can be an operator but not allowed to change the overall appearance. Etc. This is how I set up most of my apps. A user can have a mix of features checked to 'on'. They are allowed to make changes, but not allowed to close the application... They can change color schemes, but can't remove elements from the display. And so on.
Nov 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Eric Veltman | last post by:
Hello everyone, I've posted this question before, but got no answer, so I'll try to reformulate the question, maybe it helps :-) By the way, this is not intended as the start of an ASP.NET...
3
by: Z D | last post by:
Hello, I've created a winform user control that, at some point in the default constructor, looks for a specifc file. When I try to load the user control to my winform's form during design time...
0
by: Jason | last post by:
I am pretty new to C# so bare with me... The design of my website utilizes tables on every page that look almost identical, save the data they are displaying. I have written the code to create...
4
by: oneeye | last post by:
Hello All, I have designed and built a web control that loads a user control at run time. The question I have is, can I Load the user control in design view? Any Ideas or code snippets would be...
11
by: Lloyd Sheen | last post by:
Is there any one who has actually done this. I have now scanned more web articles about this with the realization that not one of them (including MSDN docs) outlines how to do this. This is...
5
by: Electrified Research | last post by:
>From ASP.NET 1.1 I have a very useful UserControl which acts like a template control. I call it a CustomTemplate. Basically it gives me a re-usable look to sections of the site without having...
1
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...
4
by: sperotti | last post by:
I am writing a windows application using VS 2005. I have a user control that returns customer data. I have placed this customers user control on several forms in my application. In the OnLoad...
1
by: weboweb | last post by:
Hello aspnet experts! I have a design question for the more experienced developers (more than me at least :-)). 1) I have a page in the application I'm building that displays a web user...
3
by: Ant | last post by:
Hi, Does anybody here know how to test user controls on the fly. I build the user control, as well as the application I am testing it in but the changes made to the user control aren't seen unless...
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
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...
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
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.