自动弹出提示框

来源:互联网 发布:淘宝店铺联盟好吗 编辑:程序博客网 时间:2024/05/01 10:33

 在需要弹出提示框的页面中的<head> </head>间加入:

<meta http-equiv="refresh" content="60">

和一段JavaScript代码:

<script>
  
function FlowAlert()
  {
 
<%=str_Script%>
  }
  FlowAlert();
</script>

在cs程序文件中输出JavaScript:

str_Script = oPF.FlowAlert(EmployeeID); 

调用的公用方法:

protected string strPop = "/r/n var PopForm{0} = window.open('PublicPage/FlowAlert.Aspx?AlertType={1}&AlertID={2}','','status=no,menubar=no,scrollbars=no,width=417,height=245,left=160,top=50') ;";

//待办提醒列表
  public string FlowAlert(int EmployeeID)
  {
   string str_Script = ""; 
   FlowFunction oFF = new FlowFunction();
   ArrayList AlertList = oFF.GetFlowAlertList(EmployeeID);
   for (int i=0 ;i<AlertList.Count ;i++)
   {
    CPath_FlowAlertInfo oFlowAlertInfo = new CPath_FlowAlertInfo();
    oFlowAlertInfo = (CPath_FlowAlertInfo)AlertList[i];
    str_Script = str_Script + string.Format(strPop,"1"+i.ToString(),"1",oFlowAlertInfo.FlowAlertID.ToString());
   }
   //str_Script = "<script> /r/n " + str_Script +"</script>/r/n";
   return str_Script;
  }

原创粉丝点击