在云那方

首页 新随笔 联系 订阅 管理
using System.Web.SessionState;
public class PageBase : System.Web.UI.Page
{
    
/// <summary>
    
/// 登陆检查
    
/// </summary>
    protected override void OnLoad(EventArgs e)
    {
        
if (Session["eCase_sEmployeeName"== null)
        {
            Response.Redirect(
"login.aspx");
        }
        
base.OnLoad(e);
    }
    
/// <summary>
    
/// 消息弹出
    
/// </summary>
    
/// <param name="strMessage"></param>
    
/// <param name="type">1弹出消息,2弹出消息关闭当前窗口,3弹出消息关闭当前窗口刷新父窗口</param>
    public void MsgShow(string strMessage,int type)
    {
        
switch (type)
        {
            case 1:
                Response.Write("<script>alert('" + strMessage + "');</script>");
                break;
            case 2:
                Response.Write("<script>alert('" + strMessage + "');window.close();</script>");
                break;
            case 3:
                Response.Write("<script>alert('" + strMessage + "');window.opener.location.href = window.opener.location.href;if (window.opener.progressWindow)window.opener.progressWindow.close();window.close();</script>");
                break;
        }

    }
}
posted on 2008-09-18 16:03  Rich.T  阅读(572)  评论(0编辑  收藏  举报