Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UserControl in mulit projects same solution ?

Status
Not open for further replies.

need2progm

Programmer
Dec 13, 2002
92
US
I have a Solution containing
-c# class lib
-vb class lib
-5 vb asp web apps

In one of the asp projects I have a user control that I drop on most pages. I want to use this control on other pages in other projects with in same solution. I have added a reference to the project that contains the user control and added a line of code: imports <projectname> at the top of the aspx page.

The control can be added but get an error when running at the src...\projectname\usercontrol.

Any ideas on how to this?



 
If the user control is not in the root directory of the project but actually one level down then you would need to use...

imports <projectname>.<directoryname>

and so on.

Ron

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
ok I am very confused ... This just doesn't seem right..

I get.. Parser error tring to use the user control in different asp project all under the same solution.
Parser Error Message:
The virtual path '/ASP_SupperClass/HeaderUserControl.ascx' maps to another application, which is not allowed.

Source Error:

Line 1: <%@ Page Language=&quot;vb&quot; AutoEventWireup=&quot;false&quot; Codebehind=&quot;MainCompPage.aspx.vb&quot; Inherits=&quot;Comptency.MainCompPage&quot; %>
Line 2: <%@ Register TagPrefix=&quot;uc1&quot; TagName=&quot;UserControl&quot; Src=&quot;../ASP_SupperClass/UserControl.ascx&quot; %>
Line 3: <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>

Just doesn't seem like good coding practice to reproduce the same code 5 times for each asp project I have in this solution.

Have any sugestions?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top