我习惯用vb的
不大会javascript

解决方案 »

  1.   

    要求是有2个按钮
    可以确定或取消
    所以不要alert
    要么messagebox
      

  2.   

    <script>confirm("x");</script>
      

  3.   

    ?
    能详细点吗

    我想知道怎么能用messagebox
      

  4.   

    http://expert.csdn.net/Expert/TopicView1.asp?id=2051685
      

  5.   

    只是在WINFORM程序中能用,在ASP。NET是不行的!
      

  6.   

    winform中可以用ShowMessage();
    webform中可以用Response.Write("<script language='javascript'>alert('Error');history.back(-1);</script>");
      

  7.   

    MessageBox.Show(strConnectName, "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
    显示在服务器端,要用:
    在page_load中加入:
    button1.attributes.add("onclick","javascript:return confirm('are you sure?');")button1为你要处理事件的按钮。
      

  8.   

    首先要加引用System.Windows.Forms.dll
    之后再写命名空间using System.Windows.Forms
    那么你就可以使用
    MessageBox.Show("You must enter a name.", "Name Entry Error",MessageBoxButtons.YesNo, MessageBoxIcon.Information,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification);
      

  9.   

    如果在页面中的话就只好用javascript了response.write("<script language='javascript'>alert('dfdfd');</script>")
      

  10.   

    System.Windows.Form里的东西在WEB页面中我想是用不了的,还是用在客户端JavaScript吧
      

  11.   

    C#代码:
    Button2.Attributes["onclick"]="return confirm("是否继续?")";
      

  12.   

    agree 楼上的,大家讨论下
      

  13.   

    引用了System.Windows.Forms.dll 后,是可以用,但是只在服务器端显示,感觉没什么用处,还是用javascript 写吧~~
      

  14.   

    不老先生有个这样的控件
    http://www.aspxcontrol.com