我工作的asp.netmvc应用程序由csharp。我面临的问题,我找不到控件搜索输入类型文本框。
我搜索的行动控制器PendingRequests我找不到它。
我也搜索index.html,它不存在
那么如何获得搜索文本框请?
动作控制器
public ActionResult Index(string filenumber)
{
int employeeFileNo;
string userRole;
if (!string.IsNullOrEmpty(filenumber))
{
if (int.TryParse(filenumber, out employeeFileNo))
{
JDEUtility jde = new JDEUtility();
userRole = Workforce.GetUserRole(employeeFileNo);
if (!string.IsNullOrEmpty(userRole))
{
var EmpName = jde.GetEmployeeName(employeeFileNo);
Session[SessionKeys.UserCode] = employeeFileNo;
Session[SessionKeys.Username] = EmpName;
Session[SessionKeys.RoleCode] = userRole;
if (userRole != RoleKey.REQ)
return RedirectToAction("PendingRequests", "WorkforceRequests", null);
else
return RedirectToAction("MyRequests", "WorkforceRequests", null);
}
else
ViewBag.errorMsg = "unauthorized user";
}
else
{
ViewBag.errorMsg = "incorrect file no";
}
}
else
{
ViewBag.errorMsg = "unauthorized user";
}
return View();
}
挂起请求视图
@model IEnumerable<HR.WorkforceRequisition.Models.WorkforceRequest>
@{
ViewBag.Title = "Pending Requests";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Pending Requests</h2>
<hr />
@if (!string.IsNullOrWhiteSpace(ViewBag.msg))
{
<div class="alert alert-success">
@ViewBag.msg
</div>
}
@if (!string.IsNullOrWhiteSpace(ViewBag.errorMsg))
{
<div class="alert alert-danger">
@ViewBag.errorMsg
</div>
}
<table id="dtbl" class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.WorkforceRequestID)
</th>
<th>
@Html.DisplayNameFor(model => model.DepartmentCode)
</th>
<th>
@Html.DisplayNameFor(model => model.Section)
</th>
<th>
@Html.DisplayNameFor(model => model.RequiredPosition)
</th>
<th>
@Html.DisplayNameFor(model => model.JobTitle)
</th>
<th>
@Html.DisplayNameFor(model => model.ReportingTo)
</th>
<th>
@Html.DisplayNameFor(model => model.NationalityCategory)
</th>
<th>
@Html.DisplayNameFor(model => model.StatusRemark)
</th>
<th>
Requestor
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink("Details", "Details", new { id = item.WorkforceRequestID })
</td>
<td>
@Html.DisplayFor(modelItem => item.WorkforceRequestID)
</td>
<td>
@Html.DisplayFor(modelItem => item.DepartmentCode)
</td>
<td>
@Html.DisplayFor(modelItem => item.Section)
</td>
<td>
@Html.DisplayFor(modelItem => item.RequiredPosition)
</td>
<td>
@Html.DisplayFor(modelItem => item.JobTitle)
</td>
<td>
@Html.DisplayFor(modelItem => item.ReportingTo)
</td>
<td>
@Html.DisplayFor(modelItem => item.NationalityCategory)
</td>
<td>
@Html.DisplayFor(modelItem => item.StatusRemark)
</td>
<td>
@Html.DisplayFor(modelItem => item.CreatedByName)
</td>
</tr>
}
</tbody>
</table>
<script>
$(document).ready(function () {
$('#dtbl').DataTable({
"scrollX": true,
"pageLength": 10,
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel'
]
});
});
</script>
找到预期结果搜索文本框输入的位置
display text box on pending requests
1条答案
按热度按时间doinxwow1#
从屏幕截图看,似乎您需要在数据表中搜索文本框。搜索框默认显示为这样,除非您设置了任何属性不显示它。使用您的js,我能够看到搜索框您可以尝试添加"搜索":true属性添加到您的数据表中。您可以查看文档here。下面是一个工作代码段