• 进度参考代码


       1.按钮点击的时候开始监视进度
    var interval = window.setInterval(GlobalControlProcess, 1500); 2.js调用一般处理程序轮询进度 function GlobalControlProcess(){ $.post("/Common/ComputeProcess.ashx", {ComputeType:"rsk_pro"},function(data){ data=JSON.parse(data); if (data.state.toString() == "7") { SetCompleted(); window.clearInterval(interval); } else{ SetPorgressBar(Math.ceil(parseInt(data.state)/7*100)); $("#p"+data.state.toString()).fadeIn("slow"); } }); 3.进度完成后清除计时器 window.clearInterval(interval);
    4.一般处理程序代码
    using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Web; using Contract.Domain; using Framework; using NPOI.SS.Formula.Functions; using WebApp.Common; namespace HraWeb.Common { /// <summary> /// EntityJsonList 的摘要说明 /// </summary> public class ComputeProcess : BasePage, IHttpHandler, System.Web.SessionState.IRequiresSessionState { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; //context.Response.ContentType = "application/json"; context.Response.Cache.SetCacheability(HttpCacheability.NoCache); if (context.Request["ComputeType"]!=null&&!string.IsNullOrEmpty(context.Request["ComputeType"])) { string computeType = context.Request["ComputeType"]; if (HttpContext.Current.Session[computeType] == null) { HttpContext.Current.Session.Add(computeType,1); } var obj = new {state = HttpContext.Current.Session[computeType.ToString()]}; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(obj)); context.Response.End(); } } public bool IsReusable { get { return false; } } } }
  • 相关阅读:
    SQL Functions
    wse 3.0
    mvc2 在 .net 4 下的ValidateInput(false) 无效
    FF3.0 不可以post空
    也谈.NET MVC 2 + ExtJS的部署问题
    ExtJs懒人笔记(2) ExtJs页面布局
    关于算法—— 一维字符串数组之间组合问题的C#实现
    (转)在ASP.NET 中实现单点登录(利用Cache, 将用户信息保存在服务器缓存中)
    XML中配置正则表达式的写法
    .NET MVC 下实现消息推送
  • 原文地址:https://www.cnblogs.com/kexb/p/5222821.html
Copyright © 2020-2023  润新知