日期:2014-05-17  浏览次数:20532 次

MVC 按钮无法提交
以下是前台代码:
  @using (Html.BeginForm("login", "Acount","post"))
  {
<div id="usernameFld" class="row showErr">
  <label class="label ib" for="username">用户名:</label>
<div id="username" class="inputContainer">
<!-- init用于设置input没有焦点的时候的占位文字和颜色 -->
  @Html.TextBoxFor(m => m.Name, new { @name="username" ,@title="username", @class="input" , @maxlength="25" ,@tabindex="1" ,@autofocus="autofocus" })
</div>
<div class="msgContainer">
<p id="usernameFldMsg">用户名应该是3-12位英文,数字或下划线</p>
</div>
  <a href="http://www.90w.com.cn/UserReg.aspx" class="regUsr">注册新用户</a>
</div><!-- 用户名 -->
<div id="passwordFld" class="row">
<label class="label ib" for="password">密码:</label>
<div id="passwordContainer" class="inputContainer">
  @Html.TextBoxFor(m => m.Password, new { @class = "input", @name = "password", @tabindex = 1, TextMode = "Password" })
   
</div>
<div class="msgContainer">
<p id="passwordFldMsg">密码长度为4-12位</p>
</div>
  <a href="http://www.90w.com.cn/GetMyPwd.aspx" class="findPass">忘记密码?</a>
</div><!-- 密码 -->
  <div class="row">
  <div id="yazm" class="inputContainer">验证码:@Html.TextBoxFor(m => m.volCode, new { @class="input", 
  @name="cbxItemName",@CssClass="gen-8",@TabIndex="3",@style="width:45px;"})
  <img id="_ctl1_UserLogin1_Image1" alt="" src="/VerifyCode.ashx" width="67" align="bottom" style="padding-left:-3px"
  border="0" height="20" onclick="this.src='/VerifyCode.ashx?n='+Math.random();"
  title="看不清?换一张!" /><span style="padding-left:10px;">@Html.CheckBoxFor(m => m.RememberMe, new { @Checked = "True" })记住我</span></div></div>
  <div id="actionFld" class="row">
<div id="submitContainer" class="submitContainer">

  <input type="button" id="btnCommit" value="登录" class="submit" onclick="commit()" />
</div>
   
</div><!-- 动作区域 -->
  }
后台代码:

  public ActionResult Index()
  {
  return View();
  }
  public ActionResult login()
  {
  return View();
  }
  [HttpPost]
  public void login(Models.LogOnModel model)
  { 

  }
点击按钮不反应,数据不能提交,后台不进入 login(Models.LogOnModel model)。后来改成 JS提交,也无法提交。可以进入JS函数,就是无法提交,请大神帮忙解决,谢谢!
function commit() {
  $("#btnCommit").su