cerremony
cerremony

Reputation: 223

Accessing user controls from a separate application but within same application pool

I'm attempting to create a form page that involves the use of some user controls, and the Item.aspx file contains this line:

<%@ Register Src="~/project/path/X.ascx" TagName="X" TagPrefix="uc" %>

but somehow I keep getting the following warnings when I try to build my application:

Element 'X' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
File '~/project/path/X.ascx' was not found.

The user controls are contained in a different application, but within the same application pool on the local host. I'm completely new to C#/.Net/web development, but from what I've been able to gather, it seems that I can only access user controls and specify paths from the application root however, so the only solution I've been able to successfully implement is to copy the entire project folder into the application directory.

I'm working entirely in C#, no VB.

The codebase is established however; and it's already working without this, to the best of my knowledge, so this seems like a clunky hack. Then did I configure something incorrectly? Is there a better solution to this problem?

Upvotes: 1

Views: 57

Answers (1)

Alex Buyny
Alex Buyny

Reputation: 3185

One way could be to create a DLL file out of your control(s) and then reuse it in both of your projects. There is a question about that on stackoverlow

Upvotes: 1

Related Questions