Solved

sharing web user control between projects

Posted on 2016-08-18
2
27 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 39

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now