Ajax.ActionLink VS Html.ActionLink + Jquery.Ajax电话 [英] Ajax.ActionLink vs Html.ActionLink + Jquery.Ajax call

查看:142
本文介绍了Ajax.ActionLink VS Html.ActionLink + Jquery.Ajax电话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过Ajax.ActionLink调用一个asp.net MVC控制器(获取客户,GetCustomers的,客户);

我可以做同样的Html.ActionLink和jQuery的Ajax调用。

在哪里是区别?


解决方案

  

在哪里是区别?


在code,你必须编写的金额(减少以Ajax.ActionLink)和控制您所需要的(多与Html.ActionLink和jQuery的AJAX调用)。

所以这是code量VS所需的控制和功能水平=>由你来决定你需要哪一个。

这两种方法都是完全正常的。该Ajax.ActionLink使用jquery.unobtrisuve-AJAX脚本AJAXify幕后的主播。

我个人一直使用Html.ActionLink + jQuery的。

I can call an asp.net mvc controller via Ajax.ActionLink("Get customers","GetCustomers","Customer");

I can do the same with the Html.ActionLink and a jquery ajax call.

Where is the difference?

解决方案

Where is the difference?

In the amount of code you have to write (less with Ajax.ActionLink) and the level of control you need (more with Html.ActionLink and a jquery ajax call).

So it's amount of code vs level of control and functionality needed => up to you to decide which one you need.

Both approaches are perfectly fine. The Ajax.ActionLink uses the jquery.unobtrisuve-ajax script to AJAXify the anchor behind the scenes.

Personally I always use Html.ActionLink + jQuery.

这篇关于Ajax.ActionLink VS Html.ActionLink + Jquery.Ajax电话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆