@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.
}
}
我想要上面的东西。OnBegin 不需要这样做。可能是另一种解决方案。
谢谢。