需要GridView的ASP.Net进度 [英] Need progressbar in GridView ASP.Net

查看:126
本文介绍了需要GridView的ASP.Net进度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请看看这个图片

Please have a look at this image

图片显示了一个ASPX页面(.NET 2.0)上的一些列的gridview的。在这里,让所有股票列表后,我要创建的发票,然后以这些发票转换为PDF。我要的是在状态栏中的进度条。而不是显示未完成或者完成状态我想显示一个进度条以突出的发票和PDF创建的过程。

The image shows a gridview with some columns on an ASPX page (.net 2.0). Here after getting the list of all stocks, i have to create invoices and then to convert those invoices into PDF. What i want is a progress bar in Status column. Rather than showing Pending or Completed status I want to show a progress bar to highlight the process of invoice and pdf creation.

你有什么想法,我怎么能做到这一点。如果你还不明白再考虑上传图片中的Orkut网页,显示进度条作为图像上传

Do you have any idea, how i can do that. If you still not understand then consider uploading images page in Orkut, that shows progressbar as the image is uploaded.

感谢您分享您宝贵的时间...

Thanks for sharing your valuable time...

推荐答案

要告诉你需要从服务器获取的状态并更新客户端的UI实际进展。一种方法是使用HTTP处理程序和AJAX与jQuery

To show actual progress you would need to get the status from the server and update the UI at client side. One way is to use HTTP Handlers and AJAX with jQuery.

1。启动InvoiceCreation

$("#btnCreateInvoice").click(function() {             
       $.ajax({ type: "POST",  url: "YourHttpHandler.ashx",
       contentType: "text/html; charset=utf-8",
       dataType: "html",  
       success: function(data) { UpdateStatus-Initialize some progressbar plugin }
       });
    });

2。轮询

下一步你需要做的是轮询在T间隔服务器和获取状态。为此,我们需要调用在T间隔的功能,将发起一个AJAX调用到的HttpHandler来获得地位。

What next you need to do is to poll the server at 't' interval and get the status. For that we need to call a function at 't' interval that would initiate an AJAX call to a HTTPHandler to get the status.

$(function() {
  setInterval(update, 't');
});

function updateStatus() {
  $.ajax({ type: "POST",  url: "GetStatusHandler.ashx",
       contentType: "text/html; charset=utf-8",
       dataType: "html",  
       success: function(data) { UpdateStatus - Update some progressbar plugin }
       });
}

3。服务器端的状态管理

在你的情况就会出现一种情况,可以有多个活动的发票,所以你需要更新/维护所有这些记录每一个状态的AJAX请求。

In your case there will be a situation where there can be multiple active invoices, so you would need to update/maintain status of all those records every AJAX request.

另外,我不知道你可以使用ASP.NET服务器端进度条控件使用这种技术,因为你需要在客户端更新它们。

Also I am not sure you can use ASP.NET Server side progress bar controls with this technique since you would need to update them at client side.

这篇关于需要GridView的ASP.Net进度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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