Mvc提交按钮不执行controller里方法
button按钮
<button id="btnSave" type="submit" style="width:5%; height: 30px; line-height:30px; display:none; margin-left:40%;float: left;"onclick="javascript:saveAll();return changeDone(1)" >添加</button>
两个hidden如下:
<%=Html.HiddenFor(m => m.DONE, new { @id="txtdone"})%>
<%=Html.HiddenFor(m => m.TableHtml, new { @id = "textend" })%>
现在是点按钮一直不执行controller的方法。js返回的都为true。
这里有一个情形就是当我把<%=Html.HiddenFor(m => m.TableHtml, new { @id = "textend" })%>改成
<input type="hidden" id="textend" /> 点提交就执行controller里的方法。我不知道这是怎么回事!
相关推荐
ASP.NET MVC实现多个按钮提交的方法
有时候会遇到这种情况:在一个表单上需要多个按钮来完成不同的功能,比如一个简单的审批功能。 如果是用webform那不需要讨论,但asp.net mvc中一个表单只能提交到一个Action处理,相对比较麻烦点。 方法一:使用客户端脚本 比如我们在View中这样写: <inputtype submitvalue=审核通\u8fc7onclick this.form.action=<%>/>\n<inputtype=submitvalue=\u5ba1\u6838\u4e0d\u901a\u8fc7onclick='this.form.action=<%=Url.Action
spring mvc controller间跳转 重定向 传参
spring mvc controller间跳转 重定向 传参
spring MVC AOP注解方式如何拦截controller 例子
有人问 Sping AOP用AspectJ注解的方式拦截不到SpringMVC的controller方法? 我这里提供了一种解决方法,仅供参考
mvc中form表单提交的三种方式(推荐)
第一种方式:submit 按钮 提交 <form action="MyDemand" method="post"> 关键字: <input name="keywords" type="text" value="@keywords" /> <input type="submit" value="搜索" /> </form> 第二种方式: $(“#dataform”).ajaxSubmit() 提交 <form id="dataform" action="UpdateUserInfo" enctype="multipart/form-data" method="pos
Spring Mvc AOP通过注解方式拦截controller等实现日志管理
Spring Mvc AOP通过注解方式拦截controller等实现日志管理


