Sharing custom control between projects

M

Michael

Hi all..

I have a solution containing 5 projects, one of which is a custom control.
In one of the projects, I dragged the .ascx file from the custom control
project and dropped it onto a form. I've also referenced the custom control
project. Everything looks good, I can see properties and events, etc. The
solution builds with no errors.

The folder structure loks like this. The folder Fleet is the top level
solution with sub folders each being their own project.

Fleet
+MainMenu
+Search
+Screen1
+Screen2
+Screen3


At run time, when I try to open the page containing the custom control, I
get this error:

The virtual path '/Fleet/Search/ucFleetSearch.ascx' maps to another
application, which is not allowed.

the line causing the error is
<%@ Register TagPrefix="uc1" TagName="ucFleetSearch"
Src="../Search/ucFleetSearch.ascx" %>

How do I use my custom control from the Search project in the Screen1
project?

Thanks
 
C

Curt_C [MVP]

What we've done is create a seperate project, for all the controls. Then
just add a ref to that project to any you want to add the controls to.
Otherwise what you are getting is seperate copies of the control
 
M

Michael

Thanks Curt..

I believe that is what I'm doing: the custom control is in a project called
Search. Within the same solution, I have another project, Screen1. In the
Screen1 project, I've added a reference to the project Search. I dragged the
ascx from the project Search onto a web form in project Screen1. At run
time, I get the 'virtual path..' error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top