开发者

Ajax.BeginForm vs Ajax.ActionLink

开发者 https://www.devze.com 2023-02-18 13:59 出处:网络
I have a page on my application and when a user cli开发者_开发技巧cks a button or link (looking like a button) then I would like to fire an action in my controller and have an action on the database.

I have a page on my application and when a user cli开发者_开发技巧cks a button or link (looking like a button) then I would like to fire an action in my controller and have an action on the database.

My question is what's the difference between Ajax.BeginForm vs Ajax.ActionLink. Don't they all do the same thing? What's the advantage in using one of them over the other.

Hope you can help.

Christine


BeginForm lets you define an HTML form whose user-specified values are sent to the controller. With ActionLink, you have to specify all of the parameters right there (no user input)

0

精彩评论

暂无评论...
验证码 换一张
取 消