MsgBox

Discussion in 'ASP General' started by Lakrom, Dec 21, 2004.

  1. Lakrom

    Lakrom Guest

    Hi to all, how to put msgbox in this asp page, this send me a message
    Denied permission: 'MsgBox'
    <% Set Conn=server.createobject("ADODB.connection")
    Conn.open application("StrConRuta")
    set rs = Conn.Execute("select rut from encuestarutaparaiso where rut='" &
    rut_usuario & "'")
    if not rs.eof then
    msgbox "Gracias por tu interes pera ya has respondido esta encuesta"
    end if
    Set rs= Conn.Execute("Select * from tabladatos where rut = '" & rut_usuario
    & "'")
    if rut_usuario<>"-" then
    if not rs.eof then
    session("rut")=rut_usuario
    response.redirect("encuesta.asp")
    else
    msgbox "Tu no estás registrado"
    response.Redirect("index.asp")
    end if
    else
    msgbox "Tu no eres usuario"
    response.Redirect("index.asp")
    end if
    Conn.Close
    set rs = nothing
    %>
     
    Lakrom, Dec 21, 2004
    #1
    1. Advertisements

  2. Lakrom

    Steven Burn Guest

    You can't call a message box server side.... you need to put it on the
    client side.

    if not rs.eof then
    %>
    <script language="VBScript">
    msgbox "Gracias por tu interes pera ya has respondido esta encuesta"
    </script>
    <%
    end if

    Or if you prefer, response.write the above out to save going from ASP > HTML
    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!
     
    Steven Burn, Dec 21, 2004
    #2
    1. Advertisements

  3. Lakrom

    Phill. W Guest

    Short answer - You can't.

    Longer answer - You can't; and for a very Good Reason.

    The MsgBox, running as it would be in *Server-Side* code ("Active
    *Server* Page" being a clue) would [try to] appear on desktop of the
    web server machine - probably locked away in some dark corner of
    a machine room into which only the cleaner's ever venture and there
    certainly /won't/ be anyone there to click "OK" to get rid of the
    MsgBox. (This would also stall the entire ASP-processing thread with
    IIS as well so you'd effectively kill all ASP's on that web server).

    Regards,
    Phill W.
     
    Phill. W, Dec 21, 2004
    #3
  4. Lakrom

    Lakrom Guest

    Thanks, is been a much help really thanks.
     
    Lakrom, Dec 21, 2004
    #4
  5. Lakrom

    Steven Burn Guest

    No problem

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!
     
    Steven Burn, Dec 21, 2004
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.