Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2003
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hello, cant make this script to go.

    <%
    nstate = rs("nstate")
    observ = rs("observ")
    if cInt(nstate)>0 then
    %>
    <script type="text/javascript">
    var nstate =<%=nstate%>;
    var observ ="<%=observ%>";
    popUp(nstate,observ);
    </script>
    <%
    if cInt(nstate)=2 and cInt(Session("UserNfunc"))>0 then
    response.Redirect"Main_Backgr.asp"
    exit sub
    end if
    end if
    %>

    This script tests if the state of a DB row is 0,1 or 2. If it is 1 or 2 shows a message in a popup window. That’s what popup() do.
    When is 2, it should redirect the user out, after that popup window close.(it is a modal window)
    The problem is that when both cInt(nstate)=2 and cInt(Session("UserNfunc"))>0 conditions are true it gets redirect but doesn’t show the pop up window.

    Please some one

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    because this runs on the server side, the pop up window happens after onload. The redirect will happen first.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    What you can do is let the redirection happen in client-side (javascript)

    <script type="text/javascript">
    var nstate =<%=nstate%>;
    var observ ="<%=observ%>";
    popUp(nstate,observ);
    if (nstate==2 && <%=Session("UserNfunc")%>>0)
    location.href = "Main_Backgr.asp";
    </script>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    New Coder
    Join Date
    Aug 2003
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks got you both.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •