Хочу сделать dropdown
для логина у себя в приложении. Вот, как это выглядит.
Dropdown
будет находится в navbar
, следовательно я пишу код в Layout page
.
Вот код формы логина:
@using (Html.BeginForm("Login", "Account", FormMethod.Post))
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="@Schedule.Resources.HomeTexts.Log_In" class="btn btn-default" />
</div>
</div>
</div>
}
Проблема в том, что я использую @Html.EditorFor(model => model.Email...
для этого нужна модель, когда я подключаю модель в Layout
(@model Schedule.BLL.Model.LoginModel
) выдает вот такую ошибку:
The model item passed into the dictionary is of type 'System.Exception', but this dictionary requires a model item of type 'Schedule.BLL.Model.LoginModel'.
Как ее можно исправить? Или как лучше реализовать Dropdown login form
?