469,133 Members | 1,167 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,133 developers. It's quick & easy.

Sharing custom control between projects

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
--
Michael White
Programmer/Analyst
Marion County, OR
Nov 19 '05 #1
3 1597
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

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Michael" <xxx.xxx.xxx> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
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
--
Michael White
Programmer/Analyst
Marion County, OR

Nov 19 '05 #2
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.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OT**************@TK2MSFTNGP11.phx.gbl...
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

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Michael" <xxx.xxx.xxx> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
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
--
Michael White
Programmer/Analyst
Marion County, OR


Nov 19 '05 #3
dont drag it from the other app. Add it manually, so that it retrieves it
from the REFERENCE not the physical file.
Either add it in the design mode or add it to the toolbox and drag it form
there

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Michael" <xxx.xxx.xxx> wrote in message
news:O5**************@TK2MSFTNGP12.phx.gbl...
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.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:OT**************@TK2MSFTNGP11.phx.gbl...
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

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Michael" <xxx.xxx.xxx> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
> 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
> --
> Michael White
> Programmer/Analyst
> Marion County, OR
>
>



Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Robert W. | last post: by
2 posts views Thread by Matze | last post: by
3 posts views Thread by brynja | last post: by
3 posts views Thread by Shikari Shambu | last post: by
2 posts views Thread by Ajeet YS | last post: by
3 posts views Thread by darrel | last post: by
4 posts views Thread by Anders K. Jacobsen [DK] | last post: by
1 post views Thread by Joe | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.