Disable client-side validation in MVC 3 “cancel” submit button

后端 未结 4 1755
梦谈多话
梦谈多话 2020-12-02 15:39

OK, been trying things for hours and could use some help. I\'m trying to implement a page in MVC 3 that has \"back\" and \"next\" buttons. When the back button is clicked I

4条回答
  •  一生所求
    2020-12-02 15:59

    What is this mystical force that causes the answer to reveal itself as soon as you post a question somewhere?

    It looks like in MVC 3 you disable client-side validation on a button by adding the class "cancel" to it. So in my example:

    
    

    works great. And no ID attribute is needed either. If you have an actual style class on the button, just do this:

    
    

提交回复
热议问题