Ajax.ActionLink will not work if validation is false?
问题 @Ajax.ActionLink("like", "Like", "Article", new { postId = Model.post.PostId, userName = User.Identity.Name }, new AjaxOptions { OnBegin = "OnBegin" }, new { @class = "like_link" }) function OnBegin() { if( true ) // value from client side. not returning value from server. { // I dont want to work the link. I want only alert message. } else { // Go to controller with parameters. } } I want something like above. OnBegin is not neccesary to do it. May be another solutions. Thanks. 回答1: OnBegin