ASP.net中怎么写类似MessageBox的代码(c#),MSDN查了很长时间也没查到。

解决方案 »

  1.   

    自己模拟吧!用脚本!简单的就是
    response.write("<script>alert('something you want to  show');</script>");
    response.write("<script>confirm('something you want to  show');</script>");
      

  2.   

    Page.RegisterStartupScript("Startup","<script>alert('message');</script>");
      

  3.   

    string message;
    message="xo";
    response.write("<script>alert('"+ message +"');</script>");
      

  4.   

    button1.attributes.add("onclick","return window.confirm('你要提交,确认吗?');")
      

  5.   

    用客户端脚本实现javascript
    response.write("<script>alert('添加成功');</script>");
      

  6.   

    button1.attributes.add("onclick","return window.confirm('确认吗?');")
      

  7.   

    我是在后台用response.write模拟环境用MessageBox比较省事。
      

  8.   

    /// <summary>
    /// 传一个要显示的字体串,会alert一个包含传入字体串的消息框。
    /// </summary>
    /// <param name="page">当前页</param>
    /// <param name="msg">提示信息</param>
    public static void ShowMsg(System.Web.UI.Page page,string msg)
    {
    page.RegisterStartupScript("ErrMsg","<script language=javascript>alert('"+msg+"');</script>");
    }
      

  9.   

    MessageBox是服務器端運行的所以你得用腳本javascript
      

  10.   

    你所说的 MessageBox是C/S结构 使用的代码B/S结构用的是客户端的提示框等等 response.write("<script>alert('Ok');</script>");