Ok, im probably doing this wrong... But in my main _Layout I have this:
<div id="navigation">
@RenderSection("Navigation")
</div>
which points to this in my Index.cshtml view:
@section Navigation{
<-- Need this to point to Views/Shared/Navigation.cshtml -->
}
But I don't want to have a huge file with all my code in it, so I need to know how to point to a file called "Navigation.cshtml" inside of this section - basically so I have all my sections in separate, independent files.
I tried just doing @RenderPage("Navigation.cshtml") in the _Layout instead of @RenderSection, and that gives errors.
--EDIT--
If I add this instead of @RenderSection()
<div id="navigation">
= @RenderPage("~Views/Shared/Navigation.cshtml")
</div>
I get this:
The file "~/Views/Shared/~Views/Shared/Navigation.cshtml" could not be rendered, because it does not exist or is not a valid page.
--EDIT--
FULL _Layout.cshtml:
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"> </script>
</head>
<body>
<div id="wrapper">
<div id="content">
<!-- BANNER -->
<div id="banner">
</div>
<!-- NAVIGATION -->
<div id="navigation">
@RenderPage("Navigation.cshtml")
</div>
<!-- MAIN DISPLAY -->
<div id="main">
@RenderBody()
</div>
<!-- FOOTER -->
<div id="footer">
</div>
</div>
</div>