Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

sharing web user control between projects

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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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