Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sharing web user control between projects

Posted on 2016-08-18
2
Medium Priority
?
76 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:Tom Knowlton
2 Comments
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 2000 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:Tom Knowlton
ID: 41765926
Thank you.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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 …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

886 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