473,404 Members | 2,213 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,404 software developers and data experts.

Reusable ASP.NET User Controls!?!?


I love how easy it is to develop ASP.NET user controls. They are fast
to make and easy to reuse within your web application. However,
sometimes I want to make controls that I use in one web application and
I want to reuse them in another application. However, I can't figure
out how to put them into any kind of library. Is it even possible? I'd
like the reusability across projects of Custom Controls with the
simplicity and elegance of User Controls. How can I achieve this?
Thank you.

David


Meet people for friendship, contacts,
or romance using free instant messaging software! See a picture you
like? Click once for a private conversation with that person!

www.socialnetwork.com
<a href="http://www.socialnetwork.com">SocialNetwork.com</a>

*** Sent via Developersdex http://www.developersdex.com ***
Jun 15 '06 #1
4 1934
"DaveOnSEN" <an*******@devdex.com> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
How can I achieve this?


Visual SourceSafe. Look at "sharing" between projects - will do exactly what
you want.
Jun 15 '06 #2
On Thu, 15 Jun 2006 08:44:46 -0700, DaveOnSEN wrote:
I love how easy it is to develop ASP.NET user controls. They are fast
to make and easy to reuse within your web application. However,
sometimes I want to make controls that I use in one web application and
I want to reuse them in another application. However, I can't figure
out how to put them into any kind of library. Is it even possible? I'd
like the reusability across projects of Custom Controls with the
simplicity and elegance of User Controls. How can I achieve this?


The problem is that user controls generally need their accompanying ASCX
file. You could write a user control totally in code, but that might be
more trouble than it's worth. There's no real problem with creating user
controls as libraries otherwise. Just create a library project in your
desired language, and include the relevant references and imports.
Jun 15 '06 #3
That doesn't really give you code-reuse though in my opinion. As I
understand it, if you develop a user control the ascx and code need to be
included in the application's project, which means if you want to use the
same user control in more than one app, the ascx and code reside as copies
of each other in each project. That's not re-use, that's copy and past.

If you truly want re-use I think you need to build a custome server side
control so you can compile it to a dll, and then you can reference that dll
from all sorts of apps. The downside is you need to code the interface
rather than design it in a forms designer.

"Erik Funkenbusch" <er**@despam-funkenbusch.com> wrote in message
news:qc**************@funkenbusch.com...
On Thu, 15 Jun 2006 08:44:46 -0700, DaveOnSEN wrote:
I love how easy it is to develop ASP.NET user controls. They are fast
to make and easy to reuse within your web application. However,
sometimes I want to make controls that I use in one web application and
I want to reuse them in another application. However, I can't figure
out how to put them into any kind of library. Is it even possible? I'd
like the reusability across projects of Custom Controls with the
simplicity and elegance of User Controls. How can I achieve this?


The problem is that user controls generally need their accompanying ASCX
file. You could write a user control totally in code, but that might be
more trouble than it's worth. There's no real problem with creating user
controls as libraries otherwise. Just create a library project in your
desired language, and include the relevant references and imports.

Jun 15 '06 #4
Umm.. that's basically what I said.

On Thu, 15 Jun 2006 15:25:10 -0700, Jeremy Chapman wrote:
That doesn't really give you code-reuse though in my opinion. As I
understand it, if you develop a user control the ascx and code need to be
included in the application's project, which means if you want to use the
same user control in more than one app, the ascx and code reside as copies
of each other in each project. That's not re-use, that's copy and past.

If you truly want re-use I think you need to build a custome server side
control so you can compile it to a dll, and then you can reference that dll
from all sorts of apps. The downside is you need to code the interface
rather than design it in a forms designer.

"Erik Funkenbusch" <er**@despam-funkenbusch.com> wrote in message
news:qc**************@funkenbusch.com...
On Thu, 15 Jun 2006 08:44:46 -0700, DaveOnSEN wrote:
I love how easy it is to develop ASP.NET user controls. They are fast
to make and easy to reuse within your web application. However,
sometimes I want to make controls that I use in one web application and
I want to reuse them in another application. However, I can't figure
out how to put them into any kind of library. Is it even possible? I'd
like the reusability across projects of Custom Controls with the
simplicity and elegance of User Controls. How can I achieve this?


The problem is that user controls generally need their accompanying ASCX
file. You could write a user control totally in code, but that might be
more trouble than it's worth. There's no real problem with creating user
controls as libraries otherwise. Just create a library project in your
desired language, and include the relevant references and imports.

Jun 15 '06 #5

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

Similar topics

1
by: Rhett | last post by:
Hello,EveryBody! I'm troubled by a design problem, Hoping that you'll save me out! The Situation is: We have two project of code A and B.A is our reusable code base, B is for specified for...
2
by: John | last post by:
Hi, I have a data driven application which has some generalized components. So, for reuse, I am building the components so they can be reused in other projects ... it takes almost no extra...
27
by: Matt Kruse | last post by:
Since this topic has come up several times in other threads, I thought I'd make a separate thread and gather opinions from (hopefully) a more varied range of newsgroup participants. What are...
9
by: Bijoy Naick | last post by:
In my Visual Studio solution, I have 2 projects.. One project implements a newsletter object, the other a file upload user control. When I compile the solution, each project generates its own DLL....
12
by: TB | last post by:
Hi All: I am trying to create a variation on the standard datagrid, whereby the datagrid is only shown after pressing some buttons. This reason for this is that I would like to use the same...
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...
0
by: Toby Inkster | last post by:
Like me, you are probably confronted with many requests for surveys, questionnaires, feedback forms, registration forms and so forth: forms where the processing requirements are very simple (store...
3
by: intrepid_dw | last post by:
Hello... We are in the process of evaluating a migration strategy to VS2005 and ASP.NET 2.0 from .NET 1.1. In our existing .NET 1.1 applications, we have several controls (ASCX's) that...
2
by: freedom9ner | last post by:
Hello, I'm investigating how HTML can be componentized and reusable. Remember Microsoft's SCRIPTLET object (TYPE="text/x-scriptlet")? I thought this was a great invention. But other browsers do not...
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
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
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.