我在我的 asp.net mvc Web 应用程序中有以下视图,可以根据输入的 IP AND/OR MAC 进行搜索:-
@using (Ajax.BeginForm("AdvanceSearchIndex","Home",
new AjaxOptions
{
HttpMethod = "get",
InsertionMode = InsertionMode.Replace,
LoadingElementId = "progress",
UpdateTargetId = "SearchTable"
}))
{
<div>
<span class="f">IP Address </span>
@Html.EditorFor(model=>model.ip)
@Html.ValidationMessageFor(model => model.ip)
</div>
<div>
<span class="f">MAC Address </span>
@Html.EditorFor(model=>model.mac)
@Html.ValidationMessageFor(model => model.mac)
</div>@*
<input class="btn btn-success" type="submit" value="search" />
<img src="~/Content/Ajax-loader-bar.gif" class="loadingimage" id="progress2" />
}
但是有没有办法检查用户在单击搜索按钮时是否输入了 IP 或 MAC 或两者,我需要一种方法来检查客户端和服务器端的这个。任何人都可以建议吗?