Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 21, 2012 02:04 PM by ramiramilu
Sep 20, 2012 06:07 AM|LINK
an asp.net program that displays random images in an image control using select case statement?
can anyone help me out of this.
thanks in advance
Sep 20, 2012 07:14 AM|LINK
you can use The AdRotator Web server control in asp.net to Display images
The AdRotator control reads advertisement information from a data source, which contains one or more ad records. You can store ad information in a database table with a specific schema, and then use a data source control to read the ad records at run time.
If you have an existing table with ad information, you can map the schema of your table to the fields that are required by the AdRotator control.
see below links
Sep 20, 2012 07:26 AM|LINK
Select Top [NumberofImagetoDisplay] * From photos order by newid()
Image1.ImageUrl = [path from above query]
Sep 21, 2012 02:04 PM|LINK
a simple solution would be to store all consumed image ids in a hiddenfield...then next time when you make a sql call send these ids...in sql write a where clause with NOT IN (these ids...) with TOP 1, that will give you uniqueness
and to get randomness use this script - http://blog.sqlauthority.com/2007/04/29/sql-server-random-number-generator-script-sql-query/ , get the random
number and check if it is in supplied consumed IDs...if no, then make TOP 1 as mentioned above..