|
本帖最后由 swtseaman 于 2012-10-17 01:59 编辑
在源代码的StaticClass/Alert.cs加入以下代码:
- public static void ShowCustomIcon(string message, string iconUrl, string clsName)
- {
- MeShowCustomIcon(message, "", iconUrl, clsName);
- }
- public static void ShowCustomIcon(string message, string title, string iconUrl, string clsName)
- {
- MeShowCustomIcon(message, title, iconUrl, clsName);
- }
- static void MeShowCustomIcon(string message, string title, string iconUrl, string clsName)
- {
- if (string.IsNullOrEmpty(title)) title = "提示";
- message = message.Replace("\r\n", "<br/>").Replace("\n", "<br/>");
- title = title.Replace("\r\n", "\n").Replace("\n", "<br/>");
- var addCssJs = "Ext.util.CSS.createStyleSheet('.{0}{background:url({1}) transparent no-repeat top left;}');";
- addCssJs = addCssJs.Replace("{0}", clsName);
- addCssJs = addCssJs.Replace("{1}", iconUrl);
- var js = String.Format("{0}X.alert({1},{2},'{3}',{4});",
- string.Empty,
- JsHelper.Enquote(message),
- JsHelper.Enquote(title),
- clsName,
- "''");
- PageContext.RegisterStartupScript(js);
- PageContext.RegisterStartupScript(addCssJs);
- }
复制代码 使用方法:
- ExtAspNet.Alert.ShowCustomIcon("显示内容", "显示标题", "/images/comment.gif", "myIcon");
复制代码 显示效果:
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|