Random Problem?

Results 1 to 2 of 2

Thread: Random Problem?

  1. #1
    Simon Baillargeon Guest

    Default Random Problem?

    Hi,<BR> <BR>I have ten different ASP pages, that I would like to display randomly.<BR> <BR>I did this code but, there is an error, the random work, but I just see the border (border=2) of my table that contain image,decription etc<BR> <BR>I did test all my asp pages random1.asp - random10.asp, and they work very fine.<BR> <BR>What should I change in my code to see my asp page?<BR> <BR>I hope to receive news from you soon.<BR> <BR> <BR>Simon Baillargeon<BR> <BR><BR>&#060;% <BR>dim textRandomNmuber<BR><BR>Randomize<BR>textRandomNmu ber = Int(Rnd * 10)<BR><BR><BR><BR> &#039 -- je pense que tu dois modifier le MapPath<BR> tonfichier = Server.MapPath ( "random" & textRandomNmuber & ".asp" )<BR><BR> <BR> <BR><BR> Set FileObject = Server.CreateObject("Scripting.FileSystemObject")< BR> Set oInStream = FileObject.OpenTextFile (tonfichier, 1, FALSE )<BR> While NOT oInStream.AtEndOfStream<BR> strOutput = oInStream.ReadLine<BR> Response.Write(strOutput & "<BR>")<BR> Wend<BR> %&#062;<BR><BR><BR><BR><BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Random Problem?

    If the asp files already exist, try <BR>&nbsp&nbspResponse.Redirect tonfichier <BR>instead of reading and writing the file. You&#039ll have to make sure no HTML (headers) have been written. Writing to the stream is not going to pull in images.<BR>HIH

Posting Permissions

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