AJAX 弹出窗消息类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Text;
using System.Web.UI;
namespace WebApplication
{
??? /// <summary>
??? /// 消息類
??? ///
??? ///
??? /// </summary>
??? public class Message
??? {
??????? /// <summary>
??????? /// 母版內容頁彈出的消息方法--母版頁用到UpdatePanel
??????? /// </summary>
??????? /// <param name="page">當前彈出信息頁面 this</param>
??????? /// <param name="updatepanel">UpdatePanel ID</param>
??????? /// <param name="messgaeInfo">信息內容</param>
??????? public static void Show(System.Web.UI.Page page, System.Web.UI.UpdatePanel updatepanel, string messgaeInfo)
??????? {
??????????? ScriptManager.RegisterClientScriptBlock(updatepanel, page.GetType(), "click", "alert('" + messgaeInfo + "')", true);
??????? }
??????? /// <summary>
??????? /// 沒有用UpdatePanel的消息方法(父頁原樣顯示,不能用于彈出頁面,因為會關閉彈出頁面)
??????? /// </summary>
??????? /// <param name="page">當前彈出信息頁面 this</param>
??????? /// <param name="messgaeInfo">信息內容</param>
??????? public static void Show(System.Web.UI.Page page, string messgaeInfo)
??????? {
??????????? page.ClientScript.RegisterStartupScript(page.GetType(), "aaaa", "<script?? language=javascript>alert('" + messgaeInfo + "');window.close();</script>");
??????? }
??????? /// <summary>
??????? /// 沒有用UpdatePanel的消息方法(父頁原樣顯示,不能用于彈出頁面,因為會關閉彈出頁面)
??????? /// </summary>
??????? /// <param name="page">當前彈出信息頁面 this</param>
??????? /// <param name="messgaeInfo">信息內容</param>
??????? public static void ShowNoClose(System.Web.UI.Page page, string messgaeInfo)
??????? {
??????????? page.ClientScript.RegisterStartupScript(page.GetType(), "aaaa", "<script?? language=javascript>alert('" + messgaeInfo + "');</script>");
??????? }
???????
??????? /// <summary>
??????? /// 沒有用UpdatePanel的消息方法(父頁原樣顯示,彈出頁面)
??????? /// </summary>
??????? /// <param name="page">當前彈出信息頁面 this</param>
??????? /// <param name="messgaeInfo">信息內容</param>
??????? /// <param name="temp">隨意</param>
??????? public static void Show(System.Web.UI.Page page, string messgaeInfo, string temp)
??????? {
??????????? page.ClientScript.RegisterStartupScript(page.GetType(), "aaaa", "<script?? language=javascript>alert('" + messgaeInfo + "');</script>");
??????? }
??????? /// <summary>
??????? /// 沒有用UpdatePanel的消息方法(父頁顯示空白)
??????? /// </summary>
??????? /// <param name="messgaeInfo">信息內容</param>
??????? public static void Show(string messgaeInfo)
??????? {
??????????? System.Web.HttpContext.Current.Response.Write("<script>window.alert('" + messgaeInfo + "')</script>");
??????? }
??? }
}
轉載于:https://www.cnblogs.com/KingStar/archive/2010/04/15/1712816.html
總結
以上是生活随笔為你收集整理的AJAX 弹出窗消息类的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Neural3DMM与螺旋卷积
- 下一篇: 英语简历计算机能力描述,简历计算机水平描