1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to load articles ... one by one

Discussion in 'C#' started by 1why, Oct 10, 2006.

  1. #1
    I have twenty articles may get more
    <%
    dim article(19)

    article(0)=article1
    .....
    article(19)=article20

    for i=0 to UBound(article)
    arX=article(i)
    response.write arX&"<hr>"
    next
    %>

    my problem is:
    Every time I run the script, browser shows a blank screen for a long time to download all articles together. :confused:

    what I want is:
    How to load articles one by one to show on screen, so readers no need to wait for all 20 articles are ready.

    Please help, Thank you
     
    1why, Oct 10, 2006 IP
  2. rb3m

    rb3m Peon

    Messages:
    192
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ASP usually writes the page to a buffer while it's processing it. When it finishes processing it sends the completed thing to the client. To send the page as it is processing make this the first line in your ASP code:

    Response.Buffer=false

    This will make ASP write the content as it gets it. Another option is to include the following line before the Next in your loop:

    Response.Buffer=flush

    That causes to send the contents of the buffer at the time and then continue with whatever's next.
     
    rb3m, Oct 10, 2006 IP
    1why likes this.
  3. 1why

    1why Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi rb3m,

    Response.buffer=false
    and
    Response.flush

    all work perfectly. :)

    Thank you for your help.
     
    1why, Oct 10, 2006 IP