请问做网页时在VB脚本中可以用MsgBox吗?该怎么用?若不能用,该怎么才能做在客户端弹出系统提示框?

解决方案 »

  1.   

    不可以。MSGBOX是服务器端函数。客户端不认。
    客户端只能用Javascript。
    在服务器端可以这么写。
     Dim a As String="对不起,密码错误"
            Response.Write("<script language=javascript>")
            Response.Write("window.alert('")
            Response.Write(a)
            Response.Write("');")
            Response.Write("</script>")
      

  2.   

    Response.Write("<script language='javascript'>return confirm('确认删除信息?');</script>")
      

  3.   

    这个我知道,但javascript的Alert函数显示的样式太单调了,而VB.NET的MsgBox可以自己选择按钮和图标样式,还可以有标题,但Alert就没有,所以我想能否在用vbscript写脚本,在vbscript中调用MsgBox函数
      

  4.   

    使用vbscript
    msgbox(prompt[,bottons][,title][,helpfile,conntext])
    []可省略
    prompt是对话框中的信息
    bottons参数可选值vbokonly 0 只显示[确定]按钮
    vbokcancel 1 显示[确定]和[取消]按钮
    vbAbortRetryIgnore 2 显示[取消]、[重试]、[忽略]按钮
    vbYesNoCancel 3 显示[是]、[否]、[取消]按钮
    vbYesNo    4 显示[是]、[否]按钮
    vbCritical 16 显示“停止”图标
    vbQuestion 32 显示“问号”图标
    vbExclamation 48 显示“叹号”图标
    vbInformation 64 显示“信息”图标
    例如
    <script language="vbscript">
    rets=msgbox("你好",4,title)
    </script>