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

UserControl as unit of reuse - problems

hi all -
- I'm probably a) completely wrong b) the umpteenth person too
mention it - but I'm struggling to identify how to best work with
re-usable units of UI on an ASP page.

the problem is really:
1) UserControl - perfect *but* can't be re-used site wide - I *must*
be wrong on this surely...

2) Custom Control - perfect for some things - like sophisticated
controls, but I don't want to use these for everything - I'd like my
site(s) to be build almost entirely of re-usable components

any hints appreciated
Oliver
Nov 18 '05 #1
2 1030
Oliver,

I think you've got it about right. You are wrong about user controls. They
can be used site wide, but the key here is that they are application
specific. If you site is broken up into multiple applications you'll want to
use server controls instead. Yes, they are more complex, but you can use
them anywhere. That's the trade off.

Another option to create controls quickly is to use inheritance. For
example, if you need a text box to do something special, create a class
library, inherit the text box control already built into .Net and then
modify it.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Oliver" <sp*************@yahoo.com> wrote in message
news:58**************************@posting.google.c om...
hi all -
- I'm probably a) completely wrong b) the umpteenth person too
mention it - but I'm struggling to identify how to best work with
re-usable units of UI on an ASP page.

the problem is really:
1) UserControl - perfect *but* can't be re-used site wide - I *must*
be wrong on this surely...

2) Custom Control - perfect for some things - like sophisticated
controls, but I don't want to use these for everything - I'd like my
site(s) to be build almost entirely of re-usable components

any hints appreciated
Oliver

Nov 18 '05 #2
Jos
Oliver wrote:
hi all -
- I'm probably a) completely wrong b) the umpteenth person too
mention it - but I'm struggling to identify how to best work with
re-usable units of UI on an ASP page.

the problem is really:
1) UserControl - perfect *but* can't be re-used site wide - I *must*
be wrong on this surely...

2) Custom Control - perfect for some things - like sophisticated
controls, but I don't want to use these for everything - I'd like my
site(s) to be build almost entirely of re-usable components

any hints appreciated
Oliver


Other key differences are:
- Custom Controls can raize their own events
- Custom Controls can be added to the toolbox, both in VS.NET and
Web Matrix.
- The custom properties for Custom Controls can also be set from the
Properties pane in these editors.
For User Controls you'll have to hand-code these properties.

--

Jos
Nov 18 '05 #3

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

Similar topics

0
by: Anon | last post by:
I am programmatically populating a asp.net table control with my usercontrol (PictureBox.ascx) which is basically an assortment of an imagebutton, Label and a Linkbutton. Now while debugging the...
6
by: Peter Wone | last post by:
Hosting the WebBrowser control is easy. Customising it is not. You have to implement IDocHostShowUI, IDocHostUIHandler, IDocHostUIHandler2, and IOleClientSite, not one of which appears in a typelib...
4
by: Dennis Burdett | last post by:
I have a pretty complex control which use to be a C# windows form that I am trying to make into a control that can be dragged onto a VB6 form. I was able to make it into a com class that I could...
5
by: Guenter | last post by:
In a blog from Scott Guthrie (http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx) I found a sample to build a UserControl Library inside one ASP.NET project and then deploy it to other...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
5
by: shuisheng | last post by:
Dear All, I was told that unit test is a powerful tool for progamming. If I am writing a GUI code, is it possible to still using unit test? I have a little experience in using unittest++. But...
9
by: Johnny Jörgensen | last post by:
Hi y'all I've got a custom control that is inherited from a normal TextBox. To that, I've added a new property that I call "Units", Which is a collection class containing members of a "Unit"...
0
by: =?Utf-8?B?QWtzaGF5?= | last post by:
I'm adding UserControls as WebPart at runtime to a WebPartZone. This is working fine but when I add two or more UserControl instances, the UserControls are overlapping each other i.e. When I add...
2
by: Joe | last post by:
Is it possible to inherit from a UserControl? If I try my user control class is not recognized. Thanks, Joe
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: 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
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
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...
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...
0
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.