Links or Controllers

1

Design a web page, with boostrap, in fact download a template. I have a menu, Home, Us, Team, Contacts, etc.

<li><a href="#about" >Nosotros</a></li>

The problem is that this menu is part of the main template, _Layout.cshtml . That is to say that when I am in the browser ../Inicio/Index , the menu works well. But when I enter ../Inicio/TerminosyCondiciones , I press any title in this menu and it does not work.

I do not know how to link it. I already tried:

<li><a href="@Url.Action("Index","Inicio#about")">Nosotros</a></li>

<li><a href="@Url.Content("/Inicio/Index#about")">Nosotros</a></li>

Help me?

    
asked by JuanSe Hurtado 18.12.2017 в 00:36
source

1 answer

1

If you want to consider adding a fragment identifier, you could just do:

<li><a href="@Url.Action("Index","Inicio")#about">Nosotros</a></li>

Likewise, you might consider using @Html.ActionLink that has an overloaded method that receives the fragment identifier as a parameter.

<li>@Html.ActionLink("Nosotros", "Index", "Inicio", null, null, "about", null, null)</li>

Reference:

answered by 18.12.2017 в 02:38