VIEW
@using Hospital.Areas.Administration.Models
@model ConfirmationModel
@{
ViewBag.Title = "Index";
}
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<section class="creating-doctor-section">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.LabelFor(m => m.SelectedDoctorId)
@Html.ListBoxFor(model => model.SelectedDoctorId, Model.Doctors, new { AutoPostBack = "True", onselectedindexchanged = "DoctorSelected", Id = "docs" })
@Html.ValidationMessageFor(x => x.SelectedDoctorId, "", new { @class = "text-danger" })
<div class="submit-button">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</section>
}
МОДЕЛЬ ПРОСМОТРА
namespace Hospital.Areas.Administration.Models
{
public class ConfirmationModel
{
[Required]
public string SelectedDoctorId { get; set; }
[Required]
public string SelectedPatientId { get; set; }
public IEnumerable<SelectListItem> Doctors { get; set; }
public IEnumerable<SelectListItem> Patients { get; set; }
}
}
Ребята, как я могу показать значение (например, идентификатор доктора) на самом деле за время, пока я просто выбираю элемент в ListBox, НЕ ОТПРАВЛЯЯ как результат формы, но перед ним. Пожалуйста, дайте мне ваши решения!
Спасибо !!!