启用Ajax的WCF服务 [英] ajax enabled WCF Service

查看:115
本文介绍了启用Ajax的WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我使用下面的代码从三个表中删除列表(完美删除!).删除几乎不需要10秒.

在这里,我想显示这些等待时间的图像,请稍等.
它会在启动过程时显示,并在删除过程完成时隐藏

Friends,

I using the below code for deleting the list from three tables(Deleting Perfectly!). It will take hardly 10 seconds for deleting.

Here, I want to show please wait image for these waiting time..
It will show when starting the process and hide on delete process completed

$(document).ready(function () {
               $.ajax({
                        cache: false,
                        async: true,
                        type: "GET",
                        dataType: "json",   
                        url: "../Services/MasterServices.svc/DeleteList",
                        data: { name: vatid },
                        contentType: "application/json;charset=utf-8",
                        success: function (r) {
                            if (r != null) {
                                alert("Removed Successfully");
                            }
                        },
                        error: function (e) { alert(e.statusText); }

                    });
                });


任何帮助!!!

谢谢,
Karthik.J


Any help!!!

Thanks,
Karthik.J

推荐答案

(文档).ready(函数(){
(document).ready(function () {


.ajax({ 缓存: false , 异步: true , 类型:" , dataType:" , 网址:" , 数据:{名称:vatid}, contentType:" , 成功:功能(r){ 如果(r!= ){ alert(" ); } }, 错误:功能(e){alert(e.statusText); } }); });
.ajax({ cache: false, async: true, type: "GET", dataType: "json", url: "../Services/MasterServices.svc/DeleteList", data: { name: vatid }, contentType: "application/json;charset=utf-8", success: function (r) { if (r != null) { alert("Removed Successfully"); } }, error: function (e) { alert(e.statusText); } }); });


任何帮助!!!

谢谢,
Karthik.J


Any help!!!

Thanks,
Karthik.J


您需要在代码中添加ajaxStart()方法.在此方法中,您可以使用任何类型的加载指示器,或更改屏幕的透明度等...
You need to add ajaxStart() method to your code. Within this method, you can have any type of loading indicator, or changing the screens transparency etc...


这篇关于启用Ajax的WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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