1、页面后台代码添加如下属性:
/// <summary> /// 总数 /// </summary> private double total { set { Session["DPMS.POP.POP_ExcelLeadIn_total"] = value; } get { if (Session["DPMS.POP.POP_ExcelLeadIn_total"] == null) { return 0; } return Convert.ToDouble(Session["DPMS.POP.POP_ExcelLeadIn_total"]); } } /// <summary> /// 当前进度 /// </summary> private int cur { set { Session["DPMS.POP.POP_ExcelLeadIn_cur"] = value; } get { if (Session["DPMS.POP.POP_ExcelLeadIn_cur"] == null) { return 0; } return Convert.ToInt32(Session["DPMS.POP.POP_ExcelLeadIn_cur"]); } } /// <summary> /// 错误信息 /// </summary> private string errMsg { set { Session["DPMS.POP.POP_ExcelLeadIn_errMsg"] = value; } get { if (Session["DPMS.POP.POP_ExcelLeadIn_errMsg"] == null) { return string.Empty; } return Session["DPMS.POP.POP_ExcelLeadIn_errMsg"].ToString(); } } /// <summary> /// 开始时间 /// </summary> private DateTime startTime { set { Session["DPMS.POP.POP_ExcelLeadIn_startTime"] = value; } get { if (Session["DPMS.POP.POP_ExcelLeadIn_startTime"] == null) { return DateTime.Now; } return Convert.ToDateTime(Session["DPMS.POP.POP_ExcelLeadIn_startTime"]); } }