473,378 Members | 1,555 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.

Clean way of using polymorphism at the presentation layer - ASP.NET

A lot of times, I find myself doing UI control manipulation in the code behind and wanted to find a clean way of doing this.

Use Case: A drop down has CSS1 style, editable in Edit mode but has CSS2 style, view only in View mode

I can achieve this by simply have a set of switch case statements. I can use polymorphism and create a EditMode and ViewMode class but that requires me to have a reference to the UI control to be passed to these classes. This tightly couples the UI and the logic layer which I want to avoid.

Any ideas?
Feb 26 '09 #1
1 1114
vekipeki
229 Expert 100+
Are you sure that it must be a reference to the UI control?

You can always reference an interface, and then create several adapters (one for each UI control) which implement that interface, exposing only those properties that you need (and that are common to all controls).
Feb 27 '09 #2

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

Similar topics

11
by: Michael Rodriguez | last post by:
I have a windows form that makes a call to my BLL to get some data. The windows form has a progress bar component that I would like updated as the data retrieval takes place. However, strictly...
3
by: GP | last post by:
We are connecting to sql server database in the webservices & retrieve the data as dataset from the webservices and load it to the aspx pages ,But we find loading of the aspx pages takes longer...
5
by: Learner | last post by:
Hi there, I am just trying to set up 3 tier architecture. When i add my Datalayer project to the Business layer project the methods are exposed to in my business class. But in the similar way when...
10
by: janisgs | last post by:
Hi Is there a way to seperate code of interface in windows applications for various design purposes? Just like it can be done in ASP.NET, one code can be inherited in different skins with...
1
by: rbg | last post by:
Hi, I am trying to understand the layering concept with the ASP.NET 2.0 apps. I have a ASP.NET 2.0 Web app which has 3 layers Presentation layer which contains UI elements and Input...
6
by: Dhananjay | last post by:
hello everyone i have got a problem i want to design business layer, data access layer , presentation layer for asp.net using C#.net , can anyone help me to solve this problem. i want some...
1
by: Clark Simpson | last post by:
Hi, Apologies if this is such a simple query but if I have an ASP/.NET Application which I normally access via www.foo.com/myapp on Machine A can I access this application layer machine via a...
0
by: johnlim20088 | last post by:
Can someone help me on this? I need a sample console application built in C# net with new practice -> separate in three layer architecture 1) Presentation layer 2) Business logic layer 3)...
1
by: | last post by:
I have an application that has a presentation later, business layer, and data layer. All three projects have their own exception policy, the "UI Policy", "BL Policy", "DL Policy", all of which...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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
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...

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.