2
设置默认按钮这是我的HTML代码:如何在ASP.Net MVC
@using (Html.BeginForm("Index", "EmployeeList", FormMethod.Post, new {defaultbutton = "searchBtn" }))
{
@Html.TextBox("SearchString", ViewBag.SearchString as string, new { @id = "SearchString", @class = "form-control", placeholder = "Search Name" })
<button type="submit" name="MyButton" value="Export" class="btn btn-sm btn-danger">
<button type="submit" name="MyButton" value="Search" id="searchBtn" class="btn btn-sm btn-warning">
}
根据我的网页设计,我必须写之前,“搜索”按钮“导出”按钮的HTML代码。
虽然我填写搜索文本'导出'按钮后按下输入点击,而不是我需要'搜索'按钮点击。