locked
Server.Execute Duplicates Dynamic Content RRS feed

  • Question

  • User770364374 posted

    Hello all, this is my frist post on the forums but I have gathered much help from here via google in the past. I've tried searching google for the answer to my problem but have had no luck so far, hopefully one of you guys can help me out.

    So I created an page in ASP that loads dynamic content. With code similar to this;

    <%
    var1 = int(rnd * 5) + 1
    var2 = int(rnd * 10) + 1
    %>
    <html>
    <body>
    
    what variable 1 is: <%=var1%>
    what variable 2 is: <%=var2%>
    
    </body>
    </html>

    Then I have another page that uses Server.Execute to execute the previus file mentioned 2+ times using a loop. The code looks like this;

    <% filename = request.querystring("page") %>
    
    <table class="domtable">
    <% for j = 1 to 2%> <%qnumb = qnumb + 1%>
          <tr> 
              <td align="left">
                <%server.execute (filename)%> 
                <% If qnumb < 2 then%>
                <br/><hr><br/>
                <%end if%>
              </td></tr>
          <%next%>
        </table>

    So for the last couple of months this has been working perfectly for me, loading different numbers for both variables on the two seperate executions. Then today, I duplicated a folder on my server, renamed it and now magically, the variables are the same number every time the page is refreshed. Actually I take that back, the variables are the same about 9 out of 10 times the browser is refreshed now.

    This happened to me with the same files on my second server a month ago, and I had to delete all the files off of the second server, and DL them from my first server (the one duplicating now), then UL them back and that fixed it. Unfortunately I didnt DL the entire server contents of my first server so I'm unable to reverse the prosess. So I'm not sure if this issue is serverside, or if it's related with the code i'm writting? I just don't know why it would work for so long then just stop working out of nowhere.

    I've tried using meta no-cache controls. I deleted the new folder I duplicated earlier from the server and that didnt work. I also tried deleting files from the last couple days that have been uploaded and that didnt work either. I've tried loading 'filename' as an array such as;

    filename(1) = request.querystring("page")
    filename(2) = request.querystring("page")
    
    for j = 1 to 2
      Server.Execute(filename(j))
    
    next

    I really hope someone knows what the hell I'm doing wrong here. Frown

    -EDIT-

    I'm also doing this and getting the same results.

    <%
    'rnd.asp'
    pStr = "private, no-cache, must-revalidate" 
    Response.ExpiresAbsolute = #2000-01-01# 
    Response.AddHeader "pragma", "no-cache" 
    Response.AddHeader "cache-control", pStr
    server.execute ("rndj.asp")
    response.write ("<hr>")
    randomize(3)
    server.execute ("rndj.asp")
    %>
    <%
    'rndj.asp'
    pStr = "private, no-cache, must-revalidate" 
    Response.ExpiresAbsolute = #2000-01-01# 
    Response.AddHeader "pragma", "no-cache" 
    Response.AddHeader "cache-control", pStr
    randomize
    response.write rnd
    response.write "<br>"
    response.write rnd
    %>
    Monday, May 7, 2012 8:35 PM

All replies