0

Hello, I'm creating my first website using master pages and asp.net. As part of this project, I need to display a random banner image at the top of each web page.

Let's say i have an "images" directory with image1.jpg, image2,jpg, image3.jpg and image4.jpg.

In the past, I have used PHP to easily display a random image using this format: <img src="images/image<?php echo(rand(1,4)); ?>.jpg" /> This selects a random image ending with a number between 1 and 4.

Is there a way to do this in an asp.net website (either VB or C#) that is as simple as the PHP solution?

Thanks!

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by serkan sendur
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.