@Html.TextBox("searchStockQtyEnd", ViewBag.currentStockQtyEnd as string, new { @class = "gate-input-search form-control", @style = "margin-right: 65px;max-width:200px;", @type = "number", @oninput = "value = value.replace(/[^\\d]/g, '')" })
使用下面这种
@type = "number", @oninput = "value = value.replace(/[^\\d]/g, '')"