Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You are using </p> <blockquote> <p>Html.RenderAction</p> </blockquote> <p>so rather try</p> <pre><code>public ActionResult Menu(string category = null) { // Your controller code. return View(categories); } </code></pre> <p>instead of</p> <pre><code>public PartialViewResult Menu(string category = null) { // Your controller code. return PartialView(categories); } </code></pre> <p>it also looks like you are missing your default route mapping</p> <pre><code>routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "[Your default controller name goes here]", action = "[Your default action name goes here]", id = UrlParameter.Optional} ); </code></pre> <p><strong>Update</strong></p> <p>I don't know if all those routing rules that is specified in your RouteConfig.cs file is needed. Keep it as simple as possible, for example</p> <pre><code>public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Login", action = "Index", id = UrlParameter.Optional } ); } </code></pre> <p><strong>Update</strong></p> <p>Your Menu action is expecting a category parameter, so you will have to pass it one, or setup a proper route mapping. So change</p> <pre><code>@{ Html.RenderAction("Menu", "Nav"); } </code></pre> <p>to</p> <pre><code>@{ Html.RenderAction("Menu", "Nav", new {category = null}); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload