Page_Load
Response.Write("<script language='JavaScript'>alert('..')</script>")

解决方案 »

  1.   

    最好用RegisterStartupScript方法。
      

  2.   

    同意xrascal(横刀夺爱) 
    另一种方法:添加应用System.Windows.Forms,之后使用Imports System.Windows.Forms;就可以在web里使用MessageBox了,引用在解决方案那快可以右键添加的。MessageBox.Show("内容!.", "标题!", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
      

  3.   

    可是为何我的system中没有windows
      

  4.   

    vb 没有 RegisterStartupScript方法 吧
      

  5.   

    就算引入了System.Windows.Forms命名空间,在你的Web页上使用MessageBox是没有任何作用的,因为它是在服务器端引发的,不是为Web Forms而设计的,客户端只能用Javascript或vbscript!!!RegisterStartupScript是System.Web.UI.Page的一个方法,无论是C#还是vb都一样。