Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 asp.net mvc 中有以下输入字段:-
<input type="reset" value="Cancel" class="btn" />
但是,如果用户单击此按钮以返回到当前控制器的 Index 操作方法,我该如何指定呢?
将其包装在一个表单中(GET 方法,并使其“提交”而不是“重置”,因为它基本上只是返回索引页面的链接):
@using (Html.BeginForm("Index", "MyController", FormMethod.Get)) { <input type='submit' value='Cancel' class='btn' /> }