【发布时间】:2016-08-02 08:12:24
【问题描述】:
这是我的 CShtml 代码 我想检查员工姓名的某些情况。 如果您能提出建议,那就太好了。
@model IEnumerable<ATS.Models.clsManagerApproval>
@{
ViewBag.Title = "ManagerApproval";
Layout = "~/Views/Shared/_Layoutuser.cshtml";
}
<h2>Manager Approval</h2>
<script type="text/javascript">
$(document).ready(function () {
if ($("#EmployeeName").val() == "") {
alert("some sample text abc213");
}
})
</script>
<table style="border: 1px solid white">
<tr>
<th style="width:1px; visibility:collapse;">
@Html.DisplayNameFor(model => model.UAmasterID)
</th>
<th style="width:130px">
@Html.DisplayNameFor(model => model.EmployeeName)
</th>
</tr>
@foreach (var item in Model) {
<tr>
<td style="visibility:collapse;">
@Html.DisplayFor(modelItem => item.UAmasterID)
</td>
<td>
@Html.DisplayFor(modelItem => item.EmployeeName)
</td>
</tr>
}
</table>
我想检查员工姓名的某些情况。 如果您能提出建议,那就太好了。 谢谢
【问题讨论】:
-
什么条件?一旦你检查了它,你想做什么?你想用你的脚本做什么(你没有任何带有
id="EmployeeName"的元素)
标签: javascript asp.net-mvc-4 c#-4.0 razor