I have a little app (asp.net mvc). I have a question: in my project i have a layout - _layout.chtml, It's possible to replace the content with different content that i inject from a file?
For example: Current _layout.chtml:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
@RenderBody()
</body>
</html>
Now, i want to load new content from a file and replace the current _layout with new content as follows:
<!DOCTYPE html>
<html>
<head>
<title>My Title</title>
<link href="~/css/mycss.css" rel="stylesheet" />
</head>
<body>
@RenderPage("../Shared/_Header2.cshtml")
@RenderBody()
@RenderPage("../Shared/_Footer2.cshtml")
<script src="~/scripts/jquery.js"></script>
<script src="~/scripts/angular.js"></script>
@RenderSection("scripts", required: false)
</body>
</html>
How do i can to do that? Thanks!