cs页面代码:
ClientScript.RegisterStartupScript(this.GetType(), "AlertMessage", "<script>DialogMultiLanguageForUserSetting(\'" + sBuilder.ToString().Replace("'", @"\'").Replace("\r\n", "\\r\\n") + "\','if(typeof(RefreshSelf)!=\\'undefined\\') RefreshSelf(); else window.parent.RefreshSelf();','" + sTitle + "','" + sClose + "');</script>");
javascript 代码:
function DialogMultiLanguageForUserSetting(sContext, sClose, sTitle, sbuttonClose) {
var dMessage = '<div id="dMessage" style="display:none;"><textarea id="tbxMessage" style="height: 120px; width: 380px;background-color:White" readonly="readonly" cols="20" rows="2" '
+ 'name="tbxMessage" >' + sContext + '</textarea><br /><input id="dMessageClose" type="button" value="' + sbuttonClose + '"οnclick="'
+ sClose + 'if(typeof(closeDialogSelf)!=\'undefined\') closeDialogSelf(); else window.parent.closeDialogSelf();" style="background-color: rgb(241, 241, 237);" οnmοusemοve="MoveClass(this)" οnmοuseοut="ResetClass(this)" class="Close_Button" /></div>';
if (window.parent.document.getElementById("ContentIframe") != null) {
if (window.document.getElementById('dMessage') == null) {
$(dMessage).appendTo(window.document.forms[0]);
}
window.CreateDialogForm("dMessage", "33", "50", sTitle, "false", true);
} else {
// 29125 clear tbxMessage text
$("#tbxMessage", window.parent.document).text(sContext);
if (window.parent.document.getElementById('dMessage') == null) {
$(dMessage).appendTo(window.parent.document.forms[0]);
}
window.parent.CreateDialogForm("dMessage", "33", "50", sTitle, "false", true);
}
if ($("#dMessageClose", window.parent.document).length > 0) {
var parentHref = window.parent.location.href + "";
if (parentHref.indexOf("MyClientsClientInfo") != -1 || parentHref.indexOf("MyClientFormEdit") != -1 || parentHref.indexOf("UserMaintenance")) {
$("#dMessageClose", window.parent.document).click(function () {
window.parent.location.href = parentHref;
});
}
}
}