Re: Randomly Assign File

Discussion in 'ASP .Net' started by George Ter-Saakov, Aug 21, 2003.

  1. You are on right track.

    In HTML where your comic strip must be located
    put following <img src="<%=File%>">

    Then in Page_Load event you can generate the random file name.

    The file extension really depends on what variable File is. If it's a file
    name with extension then it works. If you assume the extension as jpg and
    File holds only file name then you need to have it like
    <img src="<%=File%>.jpg">


    George.


    "brian" <> wrote in message
    news:012701c367f5$1a9ed090$...
    > Hello,
    >
    > I am looking for help on changing the picture that is
    > loaded on my intranet page. I would perfer not to use an
    > ad rotator.
    >
    > On the form load I would like to have the page search
    > thru directory 'c:/comics' (which holds about 10,000
    > strips) and randomly pic a strip to place on the page.
    >
    > My knowledge is limited with .NET and am a novice
    > programmer. I assume I will have to declare a variable
    > that will be assigned the comic strip file name that is
    > picked randomly. And place that variable in the image
    > source location.
    >
    > So, can someone help me randomly assign a file name to
    > the declared varable:
    > Dim File as string
    >
    > Also, when the file is assigned does the file extension
    > carry over too?
    >
    > Thank You
    >
    >
    >
    >
     
    George Ter-Saakov, Aug 21, 2003
    #1
    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. Jack Moskowitz

    Re: Randomly Assign File

    Jack Moskowitz, Aug 23, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    437
    Jack Moskowitz
    Aug 23, 2003
  2. rohit

    randomly write to a file

    rohit, May 7, 2007, in forum: Python
    Replies:
    11
    Views:
    478
    Dennis Lee Bieber
    May 8, 2007
  3. =?Utf-8?B?TWFydGluSg==?=

    Upload file functionality fails randomly

    =?Utf-8?B?TWFydGluSg==?=, May 8, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    324
    Walter Wang [MSFT]
    May 14, 2007
  4. Jonathan Wood
    Replies:
    0
    Views:
    633
    Jonathan Wood
    Jan 23, 2008
  5. Zachary
    Replies:
    76
    Views:
    563
    Matt Garrish
    Apr 30, 2006
Loading...

Share This Page