Link to home
Start Free TrialLog in
Avatar of Valimai
Valimai

asked on

Reusing UserControls via IIS virtual directory or something?

hi,

i have a user control (ascx) that has a javacript file and css file. I want to be able to use it in two separate web projects. This is for .NET2.0.
I tried making the usercontrol web project a virtual directory, however the other two web projects still could not use the controls.
Tried this.
<%@ Register Src="~/UserControlLibrary/MYUC.ascx" TagName="MyControl" TagPrefix="MyCompany" %>
UserControlLibrary is my virtual off the localhost.

how do i do this?

thanks
Avatar of cmhunty
cmhunty

If you're using Visual Web Dev 2005 Express, I don't think this can be done (please correct me if I'm wrong.......). If you're using the full version of Visual Studio, create new project and select ASP.NET server control. When you've build your control, you can compile it and add it to any web appllication that you create. You don't need VS to add the control.

HTH

Chris
ASKER CERTIFIED SOLUTION
Avatar of McExp
McExp
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Valimai

ASKER

thank you very much, the article demonstrated exactly what i needed to do.

using automated build scripts, I can publish (manually) and each web project that needs the control library can copy from the published location (currently automated) on build.

I am now trying to work out how to publish on post build automatically. I have started a new question for this at
https://www.experts-exchange.com/questions/22906451/How-to-automate-publish-on-website-on-build-command-line-post-build.html

thanks heaps