标签:
1、方式1:字段加验证
----------------------
<%using (Html.BeginForm("Create", "Book")) { %>
<div>
//这里是你要提交的表单信息
<div>
<input type="submit" id="submit" name="submit" value="搜索" />
</div>
<%} %>
如果html表单中不使用@Html控件,直接写html控件,那么控制器中,要通过 FormCollection form: form["txtAccount"]; 取值
public ActionResult UserRegister(FormCollection form) { RegisterModel reg = new RegisterModel(); reg.Account = form["txtAccount"]; if (form["txtAccount"]!="huika123") {
} return View(); }
标签:
原文地址:http://www.cnblogs.com/DTWolf/p/4615277.html