473,411 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Referring to User Control in a different project

Hello everybody,

I have created a web site which has a simple user control
(LogoDisplay.ascx). This is part of a separate project called CommonControls.

I have a main Project "MainProj" from which I am referring to
"CommonControls". I have a web page Default.aspx page in MainProj that has a
UserControl "Header.ascx"

Files for "MainProj" Project file are under folder
"C:\inetup\wwwroot\MainProj"
Files for "CommonControls" Project file are under folder
"C:\inetup\wwwroot\CommonControls"

From Header.ascx user control, I am referring to LogoDisplay.ascx User
control in CommonControls projects.

The register tag in Header.ascx file looks like below

<%@ Register TagPrefix="MYCONTROL" TagName="LogoDisplay"
Src="CommonControls/LogoDisplay.ascx" %>
When I run the project I get the following error

Could not find a part of the path
"C:\Inetpub\wwwroot\MainProj\CommonControls\LogoDi splay.ascx".

I don't understand why in the above path display
"CommonControls\LogoDisplay.ascx" is concatenated with
"C:\Inetpub\wwwroot\MainProj". CommonControls is under wwwroot folder not
under MainProj folder!

Can anyone help me in resolving this issue. Basically I want to refer to a
user control in another project from a user control in another project

Thanks
pradeep

Apr 5 '06 #1
1 2957
The path that you specify within a project will be interperted as relative to
that project's root application folder. You have to copy that ascx file to
the new project if you want to be able to use it in there. You cannot access
controls across applications, unless you copy them in each project, or
compile them and place the dll in each bin folder or place them in the GAC.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"pradeep_TP" wrote:
Hello everybody,

I have created a web site which has a simple user control
(LogoDisplay.ascx). This is part of a separate project called CommonControls.

I have a main Project "MainProj" from which I am referring to
"CommonControls". I have a web page Default.aspx page in MainProj that has a
UserControl "Header.ascx"

Files for "MainProj" Project file are under folder
"C:\inetup\wwwroot\MainProj"
Files for "CommonControls" Project file are under folder
"C:\inetup\wwwroot\CommonControls"

From Header.ascx user control, I am referring to LogoDisplay.ascx User
control in CommonControls projects.

The register tag in Header.ascx file looks like below

<%@ Register TagPrefix="MYCONTROL" TagName="LogoDisplay"
Src="CommonControls/LogoDisplay.ascx" %>
When I run the project I get the following error

Could not find a part of the path
"C:\Inetpub\wwwroot\MainProj\CommonControls\LogoDi splay.ascx".

I don't understand why in the above path display
"CommonControls\LogoDisplay.ascx" is concatenated with
"C:\Inetpub\wwwroot\MainProj". CommonControls is under wwwroot folder not
under MainProj folder!

Can anyone help me in resolving this issue. Basically I want to refer to a
user control in another project from a user control in another project

Thanks
pradeep

Apr 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dave | last post by:
Greetings, I have a web application that has a folder with a section of my web application. How can I reference a user control that is one level up in the directory structure? <%@ Register...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
7
by: crowl | last post by:
VS.2003, .NET Framework 1.1, C# My goal: Creating a dll (helper.dll) which contains some UserControls and some other helpful classes in order to use it in other projects. Symtoms: The...
5
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
4
by: Eric | last post by:
I got a particular problem in visual studio 2005 There's a user control on page and I want to meka a cast like this MyPage mp=(MyPage)this.Page; Error is : cannot cast from...
3
by: Jonathan Wood | last post by:
I could really use some help on this. First of all, I want to create a Web control where I render the control completely from scratch based on information from a database. In the book...
8
by: | last post by:
I'm looking for some design guidance on a collection of projects I'm working on. The project involves a bunch of websites constructed out of a collection of user controls. Different user...
4
by: CG | last post by:
Hi I need to implement some low level security that locks a certain page if the user does come from a particular link (which is hosted on another domain). I've considered using HTTP_REFERER...
11
by: Web Search Store | last post by:
Hello, I set up a web page with 2 user controls. In classic asp, the first one did all the declarations, and the second one used the values, and could reset it. In ASP.Net so far I can't...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.