Here I have created sample that will help you out.
HTML
<div>
<style type="text/css">
.igte_rPayNet_ButtonImg
{
height: 200px;
width: 300px;
border: 1px solid;
border-radius: 8px;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var totalImages = $('[id*=hfImages]').val().split(';').length;
$('.igte_rPayNet_ButtonImg').attr('src', $('[id*=hfImages]').val().split(';')[0]);
var i = 1;
$('.igte_rPayNet_ButtonImg').mouseover(function () {
if (i >= totalImages) {
i = 1;
}
$('.igte_rPayNet_ButtonImg').attr('src', $('[id*=hfImages]').val().split(';')[i]);
i++;
return false;
});
});
</script>
<div id="footer">
<img alt="" class="igte_rPayNet_ButtonImg" />
<input type="hidden" id="hfImages" runat="server" />
</div>
</div>
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string[] filePaths = Directory.GetFiles(Server.MapPath("~/Images/"));
List<string> files = new List<string>();
foreach (string filePath in filePaths)
{
string fileName = Path.GetFileName(filePath);
files.Add("Images/" + fileName);
}
hfImages.Value = string.Join(";", files);
}
}
VB
Protected Sub Page_Load(sender As Object, e As EventArgs)
If Not Me.IsPostBack Then
Dim filePaths As String() = Directory.GetFiles(Server.MapPath("~/Images/"))
Dim files As New List(Of String)()
For Each filePath As String In filePaths
Dim fileName As String = Path.GetFileName(filePath)
files.Add(Convert.ToString("Images/") & fileName)
Next
hfImages.Value = String.Join(";", files)
End If
End Sub
Screenshot
