Button inside Navbar asp.net

0

Hi, I'm new to web programming and I'm making inroads into the MVC and BOOTSTRAP world. I have this code in which I want to put a button instead of a link in the navbar that comes by default in ASP.NET, I would like "Register" and "log in" to have the btn-primary class. I hope that can help Thanks!

<ul class="nav navbar-nav navbar-right">   
  <li>
    @Html.ActionLink("Registrarse", "Register", "Account",       routeValues: null, htmlAttributes: new { id =       "registerLink" })</li> <li>@Html.ActionLink("Ingreso al   Sistema", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
  </li> 
</ul>
    
asked by Gabo MDA 01.11.2016 в 04:15
source

1 answer

0

You could use

<ul class="nav navbar-nav navbar-right">   
    <li>
        @Html.ActionLink("Registrarse", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink", @class= "btn-primary" })
    </li> 
    <li>
        @Html.ActionLink("Ingreso al   Sistema", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink", @class= "btn-primary" })
    </li> 
</ul>

As well as defining the id you can define the class (this is at the end of the code) to assign the one required by bootstrap

    
answered by 01.11.2016 / 16:31
source