T
TdJ
Hi guys,
I am trying to build a dialog box that does the same as an "alert" but with
out the exclamation mark graphic (which is causing some users to think
something has gone wrong !?
I have included my code, the problem is obviously the fact the jscript 'key
words' are in quotes, I have tried replacing them with single quotes " ' "
and that lets me build but doesn't produce a popup.
Any Suggestions??
thanks
tom
=================
string message = SessionState.State.ExtractMessageForUser();
if (message.Length >0 )
{
// the old alert
//Page.RegisterStartupScript("UserAlert", "<script>alert('" + message +
"');</script>");
string s = null;
// Start JScript for User Alert Box
s += "<script>";
s += " function openCenteredWindow(url, name, height, width, parms)
{";
s += " var left = Math.floor( (screen.width - width) / 2);";
s += " var top = Math.floor( (screen.height - height) / 2);";
s += " var winParms = "top=" + top + ",left=" + left +
",height=" + height + ",width=" + width;";
s += " if (parms) { winParms += "," + parms; }";
s += " var win = window.open(url, name, winParms);";
s += " win.document.write('" + message + "');";
s += " if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }";
s += " return win;";
s += " }";
s += " openCenteredWindow("","User Alert", 100, 400);";
s += "</script>";
Page.RegisterStartupScript("UserAlert", s);
}
// call base prerender
base.OnPreRender(e);
====================
I am trying to build a dialog box that does the same as an "alert" but with
out the exclamation mark graphic (which is causing some users to think
something has gone wrong !?
I have included my code, the problem is obviously the fact the jscript 'key
words' are in quotes, I have tried replacing them with single quotes " ' "
and that lets me build but doesn't produce a popup.
Any Suggestions??
thanks
tom
=================
string message = SessionState.State.ExtractMessageForUser();
if (message.Length >0 )
{
// the old alert
//Page.RegisterStartupScript("UserAlert", "<script>alert('" + message +
"');</script>");
string s = null;
// Start JScript for User Alert Box
s += "<script>";
s += " function openCenteredWindow(url, name, height, width, parms)
{";
s += " var left = Math.floor( (screen.width - width) / 2);";
s += " var top = Math.floor( (screen.height - height) / 2);";
s += " var winParms = "top=" + top + ",left=" + left +
",height=" + height + ",width=" + width;";
s += " if (parms) { winParms += "," + parms; }";
s += " var win = window.open(url, name, winParms);";
s += " win.document.write('" + message + "');";
s += " if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }";
s += " return win;";
s += " }";
s += " openCenteredWindow("","User Alert", 100, 400);";
s += "</script>";
Page.RegisterStartupScript("UserAlert", s);
}
// call base prerender
base.OnPreRender(e);
====================