Hi there,
You can't use MessageBox.Show in a Web page. After all, the .NET Framework (which ASP.NET belongs to) runs at the server. Who would be there to click all those message boxes? ;)
If you want a message box, you'll need to send JavaScript to the client that calls the alert() method, so the messagebox will appear at the client. For example, this will work in an ASP / HTML / ASPX page:
<script language="JavaScript" type="text/javascript">
alert('Hi, I am a Message Box');
</script>
How you use this in C# in ASPX pages depends on what you're trying to accomplish. You can add it to the ASPX page directly, or attach it to a control like a button or a link.
You can close a Web page with this code:
<script language="JavaScript" type="text/javascript">
window.close();
</script>
Just as with the Message Box, you'll need to put this in your age somewhere, or add it to a button.
I suggest you get yourself a book or Web site about JavaScript if you want to learn things like this. ASP.NET is more that C# alone; you'll also need to know a thing or two about XHTML, CSS, JavaScript, etc.
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|