Velocity Reviews

Velocity Reviews (
-   ASP .Net (
-   -   Re: Randomly Assign File (

George Ter-Saakov 08-21-2003 05:59 PM

Re: Randomly Assign File
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">


"brian" <> wrote in message
> 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

All times are GMT. The time now is 06:03 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.