Solved

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

Posted on 2009-07-09
1
194 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 500 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

734 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