View Single Post
 
Old June 30th, 2005, 07:51 AM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

There are no "wrong" ways of doing things. There are just "better" ways.

It sounds like much of what you are doing with one of those user controls is something that should be moved to page functionality. You should concider superclassing your page.

Create a class ("BasePage" for example) that performs all the tasks you need to perform on each page. This is a better approach because it follows a more logical object design structure. The tasks you are performing are really page tasks so they should live in a page class. Then all your pages can derive from that page class. All derived pages will get all the common page tasks with a single line of code "Inherits BasePage".

This technique also solves the problem of getting user controls to talk to each other because the common tasks and data associated with them live in the base page class not in a user control.

Some years ago, I developed a technique to provide commonly used data to all pages and user controls in an application. Here's the article I wrote explaining it:

http://www.geekdork.com/WebSkeleton/...aspx?section=5

This technique may greatly simplify what you are trying to do.

-Peter