本文介绍了ASP.NET MVC ActionLink 和 post 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能告诉我如何使用 ActionLink 和 POST 方法向控制器提交值?
我不想使用按钮.
我猜它与 jquery 有关系.
Can anyone tell me how can I submit values to Controller using ActionLink and POST method?
I don't want to use buttons.
I guess it has something with jquery.
推荐答案
您不能使用 ActionLink
,因为它只会呈现一个锚点 标签.
您可以使用 jQuery AJAX 帖子.
或者只是使用或不使用 jQuery(这将是非 AJAX)调用表单的提交方法,也许在您喜欢的任何控件的 onclick
事件中.
You can't use an ActionLink
because that just renders an anchor <a>
tag.
You can use a jQuery AJAX post.
Or just call the form's submit method with or without jQuery (which would be non-AJAX), perhaps in the onclick
event of whatever control takes your fancy.
这篇关于ASP.NET MVC ActionLink 和 post 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!