user979331
user979331

Reputation: 11861

ASP.NET MVC Hyperlink one project to another

I added another project to my solution following these instructions:

https://msdn.microsoft.com/en-us/library/cc296386.aspx

Now I have two projects in one solution.

My question is, is it possible to have a hyperlink to another project Controller?

Lets say my projects were named Project1 and Project2 in Project1 I am trying to create a hyperlink to Project2 Home controller

<a href="~/Project2/Home/Index"></a>

When I try that I get The resource cannot be found.

Instead of adding another project to the solution, should I just add the Project2 folder to Project1 ?

Upvotes: 2

Views: 2082

Answers (1)

juunas
juunas

Reputation: 58733

The other application would normally run on a different hostname / port / both. So you can't link to ~/Project2/etc, since ~ signals a virtual path inside the current app. You should use an absolute path like http://localhost:81/Project2/etc, assuming your app is running on port 81 on your local computer.

Upvotes: 4

Related Questions