用JS脚本:alert("你的字符串"),这个是我的一个函数: public void MsgBox( Page _Page, string _Msg )
{
StringBuilder StrScript = new StringBuilder(); 
StrScript.Append( "<script language=javascript>" );
StrScript.Append( "alert('"+ _Msg +"');" ); 
StrScript.Append( "</script>" ); 
_Page.RegisterStartupScript( "MsgBox", StrScript.ToString() );
}

解决方案 »

  1.   

    Response.Write("<script language=javascript>alert("xxxxxxxxxxxx");</script>");
      

  2.   

    Response.Write("<script language=javascript>alert("xxxxxxxxxxxx")</script>");
      

  3.   

    Response.Write("<script Language=JavaScript>");
    string url="viewfu.aspx?id="+Id;
    Response.Write("ChildWindow = window.open('"+url+"', '111', 'width=400,height=300,top=150,left=200,toolbar=no,status=yes,location=no,menubar=no,directories=no,scrollbars=yes,resizable=no')");
    Response.Write("</script>");
      

  4.   

    弹出一个带按扭的框。判断用户的选择。
    Button1.Attributes["onclick"]="javascript:if(window.confirm('是or否?')){return true;}else{return false;}";
      

  5.   

    btnDelete.Attributes.Add("onclick", "return confirm('真的要删除吗?');")
      

  6.   

    忘了说,是在PageLoad中写!!!别忘了给分哦
      

  7.   

    在你的项目中添加引用:System.Wimdows.Forms调用MessageBox.Show 方法  ,在指定对象的前面显示具有指定文本、标题、按钮、图标、默认按钮和选项的消息框。参数如下:[Visual Basic]
    Overloads Public Shared Function Show( _
      ByVal owner As IWin32Window, _
       ByVal text As String, _
       ByVal caption As String, _
       ByVal buttons As MessageBoxButtons, _
       ByVal icon As MessageBoxIcon, _
       ByVal defaultButton As MessageBoxDefaultButton, _
       ByVal options As MessageBoxOptions _
    ) As DialogResult参数:
    owner 
    IWin32Window,消息框将显示在其前面。 
    text 
    要在消息框中显示的文本。 
    caption 
    要在消息框的标题栏中显示的文本。 
    buttons 
    MessageBoxButtons 值之一,它指定在消息框中显示哪些按钮。 
    icon 
    MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。 
    defaultButton 
    MessageBoxDefaultButton 值之一,它指定消息框的默认按钮。 
    options 
    MessageBoxOptions 值之一,它指定将用于消息框的显示和关联选项。注意:
    MessageBoxOptions 值要选择Windows.Forms.MessageBoxOptions.ServiceNotification,否则会报错。
      

  8.   

    topzhangbo() 
    你有没有试过,你写的代码是在客户端执行的吗?
    我也是用的System.Window.Form的消息框,可是全部都是在服务器端执行的,客户端的确认过程,现在反而到了服务器端~!
    所以,用消息框还是用客户端脚本语言来实现的好~!
      

  9.   

    我怎么看不懂,你们怎么把用户选择的是yes,no返回到服务器端呢??
      

  10.   

    >>>我怎么看不懂,你们怎么把用户选择的是yes,no返回到服务器端呢??
    ============
    系统自动完成返回。因为这种对话框很简单,不是很复杂。就是除了[确定],就是[取消]了,别的还没有遇到过。