changing images dynamicaly from database

Posted by Tdhivamca under ASP.NET on 11/11/2010 | Points: 10 | Views : 1192 | Status : [Member] | Replies : 1
I want to dispaly a image it should automatically change images from DB as like a monthly winners of announcement section.

Please give sample how we can do this

Dhivakaran T


Posted by: SheoNarayan on: 11/11/2010 [Administrator] HonoraryPlatinum | Points: 25

There are following steps involved in it.

1. Create an aspx or ashx file that will connect to the database and based on the image id, fetch the image from database and show
2. Write JavaScript code using timer that will replace the src attribute of the img html tag after certain internal. The src should have different image ids so that after every interval a new image will come.

In order to to fetch the image from database, you can take help of this article, not exactly the same but it will certainly give you an idea at least on how to call the aspx or ashx file and show the image (read the "How to Call" section).


Sheo Narayan

Tdhivamca, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response