Solved

sharing web user control between projects

Posted on 2016-08-18
2
39 Views
Last Modified: 2016-08-22
I have 2 different projects, one that has **just** a web user control ("UC"), and another one that wants to reference and use that project ("PARENT").

I've referenced the "UC" project in the "PARENT" but when I try to add a reference to the .ascx that resides inside of "UC", I get an error at runtime:

http:/localhost/DealerSocket.Web.Common.UserControls/uc_DatePicker.ascx' is not a valid virtual path.

I've added the "UC" project as a virtual path, so I am not sure what more I can do.

web page (.aspx) markup:

<%@ Register src="http://localhost/DealerSocket.Web.Common.UserControls/uc_DatePicker.ascx" tagname="uc_DatePicker" tagprefix="uc2" %>

Open in new window


then futher down:
<uc2:uc_DatePicker ID="uc_DatePicker1" runat="server" />

Open in new window



How do I correct this problem?

Also I've removed the block for .ascx file types in IIS so it's not that.
0
Comment
Question by:knowlton
2 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 41761701
It's looking for a relative path.  

So if localhost is the default starting path of your website:
src="/DealerSocket.Web.Common.UserControls/uc_DatePicker.ascx"

If you don't have a relative path copy it into a sub folder and put the control in there.
0
 
LVL 5

Author Closing Comment

by:knowlton
ID: 41765926
Thank you.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to check to see if datatable has headers or not 2 29
PrintingFoundIt(Almost!(Damn!)) 1 27
Cant save 3D 4 20
C# LINQ ForEach() question 6 28
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question