Answer the question
In order to leave comments, you need to log in
MVC 3??????????
Hello!
I have such a problem:
I have @RenderPage(Url.Content("~/Views/Storage/Menu.cshtml")) on my page,
how to make it so that it is done with help:
public ActionResult Menu()
{
return view(something);
}
??
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Put "Menu.cshtml" in the folder "~/Views/Shared/"
Add an underscore to the beginning of the file name.
Then in any controller use this code:
public ActionResult Menu()
{
return PartialView("_Menu.cshtml");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question