I'm trying to generate a password input with Html.PasswordFor()
but it seems to generate the wrong name.
This is my entire code:
@using System.Web.UI.WebControls
@using Duzan.Domain.Entities
@model IEnumerable<Korisnik>
@{
ViewBag.Title = "Login";
}
@ViewBag.Nered
<div class="container">
<div class="row">
@foreach (var k in Model)
{
<div class="col-xs-6 col-sm-3" style="padding-bottom: 10px;">
<div class="center-block" style="height: 150px; width: 150px; border: black solid 2px; text-align: center">
@k.Ime
@using (Html.BeginForm())
{
@Html.Hidden("Id", k.Id)
@Html.PasswordFor(m => k.Lozinka, new {name = "Lozinka", id = "Lozinka", placeholder = "lozinka", style = "width: 90%"})
<input type="submit" @*style="visibility: hidden"*@/>
}
</div>
</div>
}
</div>
</div>
This is the HTML generated:
<input id="Lozinka" name="k.Lozinka" placeholder="lozinka" style="width: 90%" type="password">