Add web user control to class library project in Visual Studio 2003

Posted on 2005-04-06
Last Modified: 2012-06-21
I have a Solution in VS2003.  Within this solution are a number of projects.  One is a web project and the rest are class libraries where user controls are created to be used in the web project.

It is now my turn to create a new project.  I want to be able to add web forms and web user controls but I don't want the project to be a web project.  The end result is the web project will reference the class libraries DLL and any other necessary files will be copied over to the appropriate folders within the web structure.

This is somewhat akin to the likes of DotNetNuke and Rainbow.  I am creating a module that I will be adding (although not to either of these products, just one sort of like them).

What kind of project do I create so I can add whatever ascx, aspx and cs files I want?
Question by:dij8
    LVL 7

    Expert Comment

    >>but I don't want the project to be a web project
    y u dont want it to be a web project?, cos a web project can add all the files u specified(ascx, aspx, cs)
    LVL 10

    Author Comment

    I tried it as a web project but that seemed to not work.  I don't need the web.config or global.asax because it is not an individual web site.  It will never be a web site.  There will never be a start page because it won't work like that.  I just want to use class files, user controls and occasional stand-alone web pages.

    Individual class files will do the usual individual class thing.  User controls will be loaded into my existing website kind of like the modules of DotNetNuke and rainbow.  I also need web pages as separate pop-ups.  What sort of project will do this?
    LVL 9

    Expert Comment

    Just create an empty project then...

    File > New > Project > Empty Project

    LVL 10

    Author Comment

    Sorry.  I haven't forgotten this one.  It has just been put on hold.  I should be able to test within the next week or two.
    LVL 10

    Author Comment

    An empty project doesn't give me the ability to create aspx or ascx pages.  A blank project is exactly what I want though.  I just don't want to have to deal with web addresses and the like.  Which makes the choice of an empty web project just as bad.  The whole solution is controlled under VSS and when I try to add web projects from source safe on my PC at home I have issues with web addresses that don't exist.

    Is there a plug-in or whatever they're called for VS2003 that allows opening of any file type?  When I try to add a new item aspx and ascx files are just not an option in my current projects.  I'm mostly new to .Net so kind of need the extra files and code bits that are added automatically within VS2003.
    LVL 10

    Author Comment

    In thinking through the idea of a plug-in I did a more refined search and found this page:

    Which in turn sent me to this page:

    This works perfectly and took me minutes to do.  Now when I want to add a new item in the add new item dialog there are two panels (as before) and in the left panel is a folder structure (as before) to select the type of files you want.  I now have an extra folder called "web" where all the usual web file types are.

    That this is not an option in VS2003 already I think is a major shortfall.  I haven't seen VS2005 so maybe they have it sorted in that but I think this solution is worth keeping because me and the person who wrote the article I read can't be the only ones wanting to achieve this.  Can this question be PAQ'd please TheLearnedOne?
    LVL 1

    Accepted Solution

    Submitted to PAQ with points refunded (250)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now