In Windows.Forms, use
MessageBox.Show("hello world");In ASP.Net, use
<script language="javascript">
alert("hello world!");//嘿嘿,你指望是什么?
</script>

解决方案 »

  1.   

    如果你要通过后台代码来控制消息的显示,需要使用下面的方法:
    Response.Write(@"<script language='javascript'>alert('"+"hello world!"+"');</script>");
      

  2.   

    上面的有一个小错误,更正如下:(知道哪里错了吗?)
    Response.Write("<script language='javascript'>alert('"+"hello world!"+@"');</script>");
      

  3.   

    在Windows应用程序中使用MessageBox对象如:MessageBox.Show(this,message,Title,MessageBoxButtons.OK,MessageBoxIcon.Information);
    在asp.net应用中不允许在服务器端代码中使用MessageBox,如果你想显示消息给最终用户,只能用客户端代码,如(msgbox message,title:vbs)。