Calling a view from the second project

Posted by user3128303 on Stack Overflow See other posts from Stack Overflow or by user3128303
Published on 2014-06-02T20:17:33Z Indexed on 2014/06/02 21:27 UTC
Read the original article Hit count: 117

Filed under:

I have 2 projects in the Solution (asp.net-mvc). The first project is main, the other project (1 simple controller and views (Index, Layout). I want directly from the menu in the project 1, to refer to the Index view of the second project. I added a reference but I do not know what to do. Someone help?

Ps: Sorry for my english.

Project 1

_Layout.cshtml

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
</head>

<body>
    <div>
        <nav>
            <a href="@Url.Content("~")" id="current">Home</a>
            <a href="@Url.Content( /*
                via a link you want to get to the index from Project 2
            */)">TEST</a>
        </nav>
    </div>
    <div id="main">
        @RenderBody()
    </div>
    <div id="footer">

    </div>
</body>
</html>

Project 2

HomeController.cs

namespace Panel.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    }
}

© Stack Overflow or respective owner

Related posts about asp.net-mvc