Strange error

Discussion in 'ASP General' started by PW, May 23, 2006.

  1. PW

    PW Guest

    I have an ASP that is gathering values (Activities) from the previous ASP.
    Depending on what Activities the user selects, dictates what will be
    displayed by the subsequent ASP.

    If you notice in the below code segment, if the response.end is commented
    then the javascript does not get processed and the program fails later on
    when DB selects are performed.

    If the response.end is not commented, then the javascript is processed and
    the appropriate error ("You must select 2 activities") is displayed.

    I cant figure out whats going on. Is it some kind of timing issue ?

    Thanks in advance,
    PW

    -------------------------------------------------------

    myAct1 = Request.QueryString("cbAct1")
    myAct2 = Request.QueryString("cbAct2")
    myAct3 = Request.QueryString("cbAct3")
    myAct4 = Request.QueryString("cbAct4")
    myActs = myAct1 & myAct2 & myAct3 & myAct4

    if len(myActs) <> 4 then
    %>
    <script language="Javascript">
    alert("You must select 2 activities")
    history.go(-1)
    </script>
    <%
    end if

    response.write myActs
    response.write len(myActs)
    response.end
     
    PW, May 23, 2006
    #1
    1. Advertising

  2. PW

    surf_doggie Guest

    Have you tried doing a response.flush?

    if len(myActs) <> 4 then
    %>
    <script language="Javascript">
    alert("You must select 2 activities")
    history.go(-1)
    </script>
    <%
    response.flush
    end if



    Earl
    www.jhdesigninc.com
     
    surf_doggie, May 23, 2006
    #2
    1. Advertising

  3. PW

    PW Guest

    "surf_doggie" <> wrote in message
    news:...
    > Have you tried doing a response.flush?
    >
    > if len(myActs) <> 4 then
    > %>
    > <script language="Javascript">
    > alert("You must select 2 activities")
    > history.go(-1)
    > </script>
    > <%
    > response.flush
    > end if
    >
    > Earl
    > www.jhdesigninc.com
    >



    DUDE, you are my hero!!! Thats fixed it. Its been driving me mad. Thank
    you so much. :)
     
    PW, May 24, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Panic
    Replies:
    2
    Views:
    5,458
    Marc Guardiani
    Oct 24, 2003
  2. kwaj
    Replies:
    1
    Views:
    442
    Egbert Molenkamp
    Mar 7, 2004
  3. Jan
    Replies:
    2
    Views:
    1,480
    Mike Treseler
    Dec 16, 2004
  4. Harvey Twyman
    Replies:
    8
    Views:
    586
    August Derleth
    Oct 25, 2003
  5. Sam
    Replies:
    2
    Views:
    157
    Bob Barrows [MVP]
    Nov 16, 2007
Loading...

Share This Page