Click here to Skip to main content
15,921,577 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm new in MVC, i want to remove Required Validation on Cancel button.

PLease tell me how I can remove validation from cancel button.



Thanks
Seema
Posted
Comments
Vivekh RF 24-Dec-13 1:33am    
post some code. So that we can find what validations you have written and also tell us whether u are using a plugin kind of thing or just normal validations

1 solution

Either you can convert the Cancel button as an anchor tag with @Html.ActionLink helper method and apply a css class which makes the link to looks like a button and then in the controller action for that link, you can return the specific view.

@Html.ActionLink("Cancel","Index","Products",null, new { @class="clsButtonFake"})
or

Use 2 submit buttons in the form. One for real submit and one for the cancel. and in your controller action, check which button called the action method.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900