473,788 Members | 2,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sharing usercontrols across projects

Is it practical?

I have a site we've been working on where a lot of the objects on the page
are usercontrols... the header, the footer, navigation, etc.

I need to make a stand-alone mini-site that should not be connected to the
larger project, as it will be maintained by a different group by hand.

So, I was just going to copy over a few of the controls and place them in
here. Of course, that's easy, but not ideal, as now I have duplicates of the
exact same control. Is it possible to reference a control outside of your
own project?

-Darrel
Nov 18 '05 #1
3 1169
Darrel,

If you want to share controls between projects and not duplicate the code,
then you need to create a Custom Server Control library. You will not have
the luxury of having a .ascx file to define your HTML in, thus the
complexity rating of the task goes up. But, if you are like me after you
get over the learning curve then you start to favor custom controls over
user controls. You will have to implement either the Render method or the
CreatChildContr ols method. Render() method is used when you just would like
to utilize the HtmlTextWriter class and CreateChildCont rols is used when
creating a composite control.

The other thing you end up having to make when you do a custom control
library is create Designer classes for each of your controls so you can see
your controls in a certain way while view the web form in the designer.

Here is a nice index page of information that you will need to help you
along with this task.
http://msdn.microsoft.com/library/de...ercontrols.asp

HTH
-Chris
~
http://weblogs.austinspad.com/caustin

"darrel" <no*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Is it practical?

I have a site we've been working on where a lot of the objects on the page
are usercontrols... the header, the footer, navigation, etc.

I need to make a stand-alone mini-site that should not be connected to the
larger project, as it will be maintained by a different group by hand.

So, I was just going to copy over a few of the controls and place them in
here. Of course, that's easy, but not ideal, as now I have duplicates of the exact same control. Is it possible to reference a control outside of your
own project?

-Darrel

Nov 18 '05 #2
User controls weren't really designed to be shared between projects. For
advanced functionality such as that you should create custom controls.
Here's more info:
http://msdn.microsoft.com/library/de...ebControls.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"darrel" <no*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Is it practical?

I have a site we've been working on where a lot of the objects on the page
are usercontrols... the header, the footer, navigation, etc.

I need to make a stand-alone mini-site that should not be connected to the
larger project, as it will be maintained by a different group by hand.

So, I was just going to copy over a few of the controls and place them in
here. Of course, that's easy, but not ideal, as now I have duplicates of
the
exact same control. Is it possible to reference a control outside of your
own project?

-Darrel

Nov 18 '05 #3
> Here is a nice index page of information that you will need to help you
along with this task.

http://msdn.microsoft.com/library/de...ercontrols.asp

Thanks, Chris!

-Darrel
Nov 18 '05 #4

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

Similar topics

1
1952
by: Simon Neve | last post by:
Hello, This question is related to sharing .Net projects across solutions and is reposted from the SourceSafe group. We have several different solutions and want to share common assemblies across them. Is it best to share the project and its files to each solution (each solution has it's own shared project), or have each solution point to the same file location of the project?
5
5379
by: cybertof | last post by:
Hi ! What is the common use of sharing a single .cs across multiple project files ? I think it's to share common classes between projects. I have actually a .cs file shared accross multiple projects in a same solution. It's nice to have a common "set" of Classes. Is this the only way to share classes between projects ?
0
1123
by: Darren Oakey | last post by:
G'day - is there anyway of sharing the Session data across two different ASP.Net projects? Basically, I'm jumping from a page in one to a page in another, and I'd like to have the data flit across the divide!
2
1082
by: Ajeet YS | last post by:
Hello, We need to share the same user controls among many developers in the same project. How do we achieve this? We have looked into using Custom controls, but they have a very high development time & at times can be complicated. How can we have a set of user controls, say in a separate project, and make use of it from there instead of copying the controls to each individuals project & then using it? We are VS.NET 2003 if its of any...
4
1650
by: Anders K. Jacobsen [DK] | last post by:
Hi I have some common UserControls i want to share between to sites (on the same mashine but on diffrent virtual paths). right now i have on solution file with aprox 10 projects. 2 of these is webprojetcs wich need to shere some common userControls. Optimally i want a class libarary project wich contains the controls so i could import the DLL and use the controls. But that of course doesnt work.
0
1562
by: rcolby | last post by:
Hi, A little advice on code sharing across projects, namespaces and dll's for references. I've got an application that is split between three different projects (one for a service, one for manual operation of the service and web client for the interface to the user). There are a lot of functions that are shared through these projects and I'm using the following format which is store in ApplicationNamspace.vb and doesn't seem to work...
1
1180
by: Anders Borum | last post by:
Hello! I was wondering if I am the only person missing the option of outputting a single dll for a website (just like the good old v1.1 compilation model)? What I'm looking for is the ASP.NET framework to keep away from creating random namespaces for each directory. The new build projects from the Microsoft team shows promising, but I am not aware if the compilation model is flexible enough to allow the "old" model ..
2
2277
by: David | last post by:
How do I share code across files in C#, without including a reference to a class library. Here's what I want to do. I have a device I want to talk to. It's a machine in a factory. It can talk on a serial port, or over ethernet. Either way it's talking, it sends the same data. So, I encapsulate the data structure in a class, and I stick the class in a .cs file. Now, I want to create three projects, and they all will deal with the...
2
1972
by: Jeff Dege | last post by:
I'm working with a group that's been doing C++ coding for quite a long time, now, and in that environment we've pretty much worked out development practices that serve us well. We've been doing more and more, over the last few years, in C# and ASP.NET. Some web apps, some background services. In our C++ code base, we have a fair number of statically-linked libraries that contain code we share between projects. At this point, in our...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10370
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7519
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.