2

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 ?

2
  • Have you tried to run Project2 before trying to hit the url? Commented Nov 14, 2016 at 18:38
  • 1
    For the sake of clarity, you don't link to projects. You link to websites. While it may be the case that your projects are websites, not all are. Commented Nov 14, 2016 at 19:43

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

3 Comments

FWIW, you should avoid hardcoding the absolute portion of the path. Instead, rely on either the appSettings config section or your project's Application Settings. With either approach, you'll be able to use config transforms to change the value during publish.
@juunas, I tried that and it did not work, it brings me to the same error page .
That just means the URL is wrong, I can't guess your server setup, so you have to find out what is the URL of your other app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.