Asp.net has not been able to find this resource.



  • Requested URL: /Nav/List Although there is no record on the route

    Tell me what the mistake is, here's the code.

    @model IEnumerable<string>
    

    @{
    bool horizontal = ((bool)(ViewContext.RouteData.Values["horizontalNav"] ?? false));
    string wrapperClasses = horizontal ? "btn-group btn-group-sm btn-group-justified" : null;
    }
    <div class="@wrapperClasses">
    @Html.ActionLink("Домой", "List", "Books",
    new
    {
    @class = horizontal ? "btn btn-default btn-sm" :
    "btn btn-block btn-default btn-lg"
    })

    @foreach (var link in Model)
    {
    @Html.RouteLink(link, new
    {
    controller = "Books",
    action = "List",
    category = link,
    page = 1
    }, new
    {
    @class = (horizontal ? "btn btn-default btn-sm"
    : "btn btn-block btn-default btn-lg")
    + (link == ViewBag.SelectedNameGenre ? " btn-primary" : "")
    })
    }

    </div>



  • You have a misrepresentation of Doma, semantics should be as follows:

    @Html.ActionLink("Наименование ссылки", "ActionName", "ControllerName", 
    new { 'атрибуты ссылки, такие как class и тд.' });
    

    where:

    • ActionName - it's the name of the implementation, in your case it's likely to be Index
    • ControllerName - The name of the counteraller may be any action, but by default, the main page is used Home



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2