N
N
Nikolai Kupstas2011-10-24 16:29:54
.NET
Nikolai Kupstas, 2011-10-24 16:29:54

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

1 answer(s)
D
deleted-Brazier, 2011-10-24
@Illorian

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 question

Ask a Question

731 491 924 answers to any question