Моя модель
public int NoticeId { get; set; }
public string NoticeDescription { get; set; }
[DataType(DataType.Date)]
public DateTime NoticeDate { get; set; }
, и я создаю Index Controller и View.Для модального я создаю popup.js, который я хочу показать, если NoticeDate == CurrentDate открыть модальное и NoticeDescription показать там.Как мне это сделать?
Мой код Index.cshtml
@model IEnumerable<ToDoListApp.Entities.Notice>
@Html.Partial("~/Views/ToDoes/PopUp.cshtml")
@{
ViewBag.Title = "To Do List Application";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.NoticeDescription)
</th>
<th>
@Html.DisplayNameFor(model => model.NoticeDate)
</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.NoticeDescription)
</td>
<td>
@Html.DisplayFor(modelItem => item.NoticeDate)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.NoticeId }) |
|
@Html.ActionLink("Delete", "Delete", new { id = item.NoticeId
})
</td>
</tr>
}
</table>
Мой контроллер
private DbAppContext db = new DbAppContext();
// GET: ToDoes
public ActionResult Index()
{
return View(db.Notices.ToList());
}
Я хочу показать всплывающее окно, если NoticeDate == CurrentDate.Как написать код JS.И как добавить в контроллер.