/// <summary> /// /// </summary> /// <param name="mode"></param> /// <param name="message"></param> /// <param name="msgtitle"></param> /// <param name="htmlEncodeMessage"></param> /// <param name="returnUrls"></param> /// <param name="autoJumpSeconds"></param> /// <param name="tipLogin"></param> /// <param name="returnValue"></param> internal protected void ReturnMessageShow( AlertIconInfo mode, string message, string msgtitle, bool htmlEncodeMessage, string returnUrls, int autoJumpSeconds, bool tipLogin, object returnValue) { var icon = "alert"; if (string.IsNullOrEmpty(message)) { switch (mode) { case AlertIconInfo.success: message = "当前操作成功"; icon = "success"; break; case AlertIconInfo.error: message = "当前操作发送错误"; icon = "error"; break; case AlertIconInfo.waring: break; } } else { switch (mode) { case AlertIconInfo.success: icon = "success"; break; case AlertIconInfo.error: icon = "error"; break; case AlertIconInfo.waring: break; } } Session["title"] = string.IsNullOrEmpty(Title) ? "网站温馨提示" : Title; if (htmlEncodeMessage) { message = StringPlus.HtmlEncode(message); } Session["content"] = message; if (!string.IsNullOrEmpty(returnUrls)) { Session["content"] = "<a href='" + returnUrls + "'>" + message + "(如果没有自动跳转,请点击)</a>"; } this.Context.Response.Redirect("MessageShow.aspx?icon=" + icon + ""); }
public static void ShowInfo(Page page, Type type, string message, AlertIconInfo mode, string AfterScript) { string icon = "alert"; if (string.IsNullOrEmpty(message)) { switch (mode) { case AlertIconInfo.success: message = "¡ÒôÓà¹Ô¹¡ÒÃàÊÃç¨ÊÓàÃç¨!"; icon = "succeed"; break; case AlertIconInfo.error: message = "à¡Ô´¢éͼԴ¾ÅÒ´¢Í§¡Ò÷ӧҹ"; icon = "error"; break; case AlertIconInfo.warning: icon = "warning"; break; default: break; } } else { switch (mode) { case AlertIconInfo.success: icon = "succeed"; break; case AlertIconInfo.error: icon = "error"; break; case AlertIconInfo.warning: icon = "warning"; break; default: break; } } string content = message; message = StringPlus.HtmlEncode(message); page.ClientScript.RegisterStartupScript(type, "", @"<script>art.dialog({ icon: '" + icon + "', content: '" + content + "',ok:function(){ " + (string.IsNullOrEmpty(AfterScript) ? "return true;" : AfterScript) + "} });</script>"); }
/// <summary> /// 具体操作的对话框 /// </summary> internal protected void ShowInfo(string message, AlertIconInfo mode, string AfterScript) { string icon = "alert"; if (string.IsNullOrEmpty(message)) { switch (mode) { case AlertIconInfo.success: message = "当前操作成功"; icon = "succeed"; break; case AlertIconInfo.error: message = "当前操作操作错误"; icon = "error"; break; case AlertIconInfo.waring: break; default: break; } } else { switch (mode) { case AlertIconInfo.success: icon = "succeed"; break; case AlertIconInfo.error: icon = "error"; break; case AlertIconInfo.waring: break; default: break; } } string content = message; message = StringPlus.HtmlEncode(message); ClientScript.RegisterStartupScript(this.GetType(), "", @"<script>art.dialog({ icon: '" + icon + "', content: '" + content + "',ok:function(){ " + (string.IsNullOrEmpty(AfterScript) ? "return true;" : AfterScript) + "} });</script>"); }
protected void AlertMessage(string message, AlertIconInfo icon, string AfterScript) { ShowInfo(message, icon, AfterScript); }
protected void AlertMessage(string message, AlertIconInfo icon) { ShowInfo(message, icon, null); }
/// <summary> /// 具体操作的对话框 /// </summary> protected internal void ShowInfo(string message, AlertIconInfo mode, string AfterScript) { string icon = "alert"; if (string.IsNullOrEmpty(message)) switch (mode) { case AlertIconInfo.success: message = "当前操作成功"; icon = "succeed"; break; case AlertIconInfo.error: message = "当前操作操作错误"; icon = "error"; break; case AlertIconInfo.waring: break; default: break; } else switch (mode) { case AlertIconInfo.success: icon = "succeed"; break; case AlertIconInfo.error: icon = "error"; break; case AlertIconInfo.waring: break; default: break; } string content = message; message = StringPlus.HtmlEncode(message); ClientScript.RegisterStartupScript(this.GetType(), "", @"<script>art.dialog({ icon: '" + icon + "', content: '" + content + "',ok:function(){ " + (string.IsNullOrEmpty(AfterScript) ? "return true;" : AfterScript) + "} });</script>"); }
/// <summary> /// /// </summary> /// <param name="mode"></param> /// <param name="message"></param> /// <param name="msgtitle"></param> /// <param name="htmlEncodeMessage"></param> /// <param name="returnUrls"></param> /// <param name="autoJumpSeconds"></param> /// <param name="tipLogin"></param> /// <param name="returnValue"></param> protected internal void ReturnMessageShow( AlertIconInfo mode, string message, string msgtitle, bool htmlEncodeMessage, string returnUrls, int autoJumpSeconds, bool tipLogin, object returnValue) { var icon = "alert"; if (string.IsNullOrEmpty(message)) switch (mode) { case AlertIconInfo.success: message = "当前操作成功"; icon = "success"; break; case AlertIconInfo.error: message = "当前操作发送错误"; icon = "error"; break; case AlertIconInfo.waring: break; } else switch (mode) { case AlertIconInfo.success: icon = "success"; break; case AlertIconInfo.error: icon = "error"; break; case AlertIconInfo.waring: break; } Session["title"] = string.IsNullOrEmpty(Title) ? "网站温馨提示" : Title; if (htmlEncodeMessage) message = StringPlus.HtmlEncode(message); Session["content"] = message; if (!string.IsNullOrEmpty(returnUrls)) Session["content"] = "<a href='" + returnUrls + "'>" + message + "(如果没有自动跳转,请点击)</a>"; this.Context.Response.Redirect("MessageShow.aspx?icon=" + icon + ""); }
protected void AlertMessage(string message, AlertIconInfo icon, string AfterScript) { ShowInfo(message, icon, AfterScript); }
protected void AlertMessage(string message, AlertIconInfo icon) { ShowInfo(message, icon, null); }