using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
///ScriptHelper 的摘要说明
/// </summary>
public class ScriptHelper
{
	public ScriptHelper()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
    }
    #region 弹出提示信息
    /// <summary>
    /// 弹出提示信息
    /// </summary>
    /// <param name="page">页面</param>
    /// <param name="Message">提示信息</param>
    public static void AlertMessage(Page page,string Message)
    {
        page.ClientScript.RegisterClientScriptBlock(page.GetType(), "", "<script language='javascript' defer>alert('"+Message+"')</script>");
    }
    #endregion

    #region 弹出提示信息后跳转页面
    /// <summary>
    /// 弹出提示信息后跳转页面
    /// </summary>
    /// <param name="page">页面</param>
    /// <param name="Message">提示信息</param>
    /// <param name="url">跳转的路径</param>
    public static void AlertMessageAndRedict(Page page,string Message,string url)
    {
        page.ClientScript.RegisterClientScriptBlock(page.GetType(),"","<script language='javascript' defer>alert('"+Message+"');window.location.href('"+url+"')</script>");
    }
    #endregion
}
