Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Whats the best way to share custom user controls accross mulitple websites / projects

Posted on 2009-07-09
1
Medium Priority
?
198 Views
Last Modified: 2012-05-07
I'm sure theres a simple solution to this, however i'm looking to create a series of controls, all of which can be reused across multiple projects.

The idea is that when i make an improvement to a control,  every other project that shares the control will also see the benefits.

Now Im curious on how i handle html, images, styles etc i.e. should this be present on the projects referencing this control project?

And also whats the best way to implement this from a code standards point of view?

This is quite general i admit - but any advice would be greatly appreciated, along with any working examples, as thats how i tend to understand concepts better?

Thanks
Paul
0
Comment
Question by:paulCardiff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
ahmad2121 earned 2000 total points
ID: 24816267
There are two ways:

1. Create a Web Deployement Project

Download for vs 2008:  http://www.microsoft.com/downloads/details.aspx?familyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en

How to set them up and use them: http://www.codedigest.com/Articles/VisualStudio/126_Web_Deployment_Project_for_Visual_Studio_2005_and_2008.aspx

2. Build a regular Web Project, compile it, then use that DLL as a reference (same thing as above basically)

Dealing with HTML and images is pretty easy, For those you could include them in your Web [Deployement] Project as embedded resources, then you can configure them as web resources

Here are instructions on how to set this up:

http://aspnet.4guysfromrolla.com/articles/080906-1.aspx

The benefits of this are:

1. ASP.NET code is precompiled, so you will never have syntax issues
2. Once the DLL for the project is built, you can use it with any project. The WDP is not automatically set as a reference if you include the outputted DLL only, but you can force it as a dependencies for your other projects to make sure it gets compiled first
3. Syntax to use it is very very easy

The downsides:

1. slows down your build time a lot (asp.net code compiles much more slowly)
2. quite a bit of setup involved initially, but once its working its a beauty
3. one other one I forgot, but it can't be that bad :)

Regarding better coding standards, stick to the usual ones. In the end you are going to have a library and you can use that however which way. Figure out what your namespaces will look like, draw it out, draw your dependency lines etc. And as always, when creating libraries, you want to minimize it's dependencies on other modules, and never ever have cyclic dependencies. If a function or a class can be moved to that library, move it rather than including another reference.

Thats pretty much it. Happy coding!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question