469,648 Members | 1,154 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

messagebox

hello
how I can use messagebox as windows application in web application .
Thanks
Nov 15 '05 #1
2 1478
selen,

You can't really use the same thing. If you want to have a messagebox
show up on the client in a web application, then you have to have the server
output script to the client that will call the alert method on the inherent
window object that is exposed to the document by the browser. This will
bring up a messagebox. Of course, you have to wire it up to some sort of an
event, so you have to figure out when you want it to show up as well.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"selen" <sk*****@yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
hello
how I can use messagebox as windows application in web application .
Thanks

Nov 15 '05 #2
...........and to support Nicholas's answer an example can be found below
whihc pops an alert from a button click.
<html>
<head>
<script language="C#" runat="server">
void Page_Load( Object sender , EventArgs e )
{

//Form the script that is to be registered at client side.
string ScriptString = "<script language=JavaScript> function
DoClick() {";
ScriptString += "var truthBeTold = window.confirm('Click OK to
continue. Click Cancel to stop.');";
ScriptString += "if (truthBeTold)";
ScriptString += "window.alert('Welcome to MVP World!');";
ScriptString += "else window.alert('Bye from MVP World!');}<";
ScriptString += "/";
ScriptString += "script>";

if(! IsClientScriptBlockRegistered("clientScript"))
{
RegisterClientScriptBlock("clientScript", ScriptString);
}
}

</script>
</head>
<body topmargin="20" leftmargin="10">
<form id="myForm" runat="server">
<input type="button" value="ClickMe" onclick="DoClick()">
</form>
</body>
</html>

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:e5**************@tk2msftngp13.phx.gbl...
selen,

You can't really use the same thing. If you want to have a messagebox
show up on the client in a web application, then you have to have the server output script to the client that will call the alert method on the inherent window object that is exposed to the document by the browser. This will
bring up a messagebox. Of course, you have to wire it up to some sort of an event, so you have to figure out when you want it to show up as well.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"selen" <sk*****@yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
hello
how I can use messagebox as windows application in web application .
Thanks


Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Rich Tasker | last post: by
8 posts views Thread by Dennis C. Drumm | last post: by
2 posts views Thread by Dennis C. Drumm | last post: by
8 posts views Thread by Saso Zagoranski | last post: by
4 posts views Thread by Tressa | last post: by
reply views Thread by alex_f_il | last post: by
20 posts views Thread by Peter E. Granger | last post: by
10 posts views Thread by Russ | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.