在ASP.NET MVC中绑定JQuery帖子 [英] Binding jquery post in asp.net mvc

查看:66
本文介绍了在ASP.NET MVC中绑定JQuery帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,

我有一个mvc 2应用程序,并且在视图中有几个不同的jquery帖子来获取将要填充到下拉列表中的数据. jQuery帖子加载时间通常约为半秒,但有时可能为2秒.我只是想知道每次jquery发布时是否有某种方法可以绑定事件,以便在加载时可以将鼠标定距器变成沙漏?

谢谢

Hey,

I have an mvc 2 application, and within a view there are a couple of different jquery posts to get data that is going to be populated in dropdownlists. The jquery post loading time is usually about half a second, but sometimes it can be two seconds. I was just wondering if there''s some way to bind an event every time jquery''s posting, so that I could turn the mouse courser into an hourglass when loading?

Thanks

推荐答案

您可以使用jQuery.ajaxSetup定义特定的行为,然后该行为将由您的应用程序进行的所有jQuery ajax调用.
You can use jQuery.ajaxSetup to define a particular behavior which will be followed by all jQuery ajax calls made by your application.


.ajaxSetup({ beforeSend:功能(){ // //将鼠标光标更改为沙漏 }, 完成:功能(){ // /将鼠标光标更改为普通指针 }});
.ajaxSetup({ beforeSend:function(){ /// change mouse cursor to hourglass }, complete: function(){ /// change mouse cursor to normal pointer }});


这篇关于在ASP.NET MVC中绑定JQuery帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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