asp.net 后台使用jquery的messager.alert

一,注册方法

1 private void ShowMessage(string title, string msg, string ctype)
2 {
3 ClientScript.RegisterStartupScript(this.GetType()
4 , "message"
5 , "<script language='javascript'>window.onload=function(){$.messager.alert('" + title.Replace("'", "") + "','" + msg.Replace("'", "") + "','" + ctype + "');}</script>");
6 }


二,参数

ctype可以为:error,info,question,warning

三,例子

ShowMessage('提示','更新成功!','info')

posted @ 2012-02-01 23:17  hongcn  Views(467)  Comments(0)    收藏  举报