Click here to Skip to main content
15,887,326 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am having list as a data source to the repeater.
Requirements:
1. I have to display five items and after some time(suppose 2 seconds) those items automatically replaced with next five items of list and so on...... How can i do that?

2.If there are less than five items in list ,I need to repeat those items in remaining positions.

Example:If i have only three items in list, i need to display first and second item in fourth and fifth positions.


The html structure is like this..

.cn
.sh.cn
.com.cn
.net.cn
.org.cn


What I have tried:

HTML structure is like above. based on the class the position of span tag is fixed.
Posted
Updated 28-Apr-16 20:08pm
v2
Comments
Karthik_Mahalingam 28-Apr-16 8:26am    
what is "after some time" ??
ZurdoDev 28-Apr-16 9:06am    
Use a timer. Where are you stuck?
Nigam,Ashish 28-Apr-16 9:35am    
You can use Rotator control to rotate your Products with Repeater or tables.

You can take a help with this:

ASP.NET - Ad Rotator[^]
 
Share this answer
 
I would have used JavaScript/JQuery:

1. Declare pageIndex(your list's current page) and pageSize(number of records to show).
2. Get the list of records in JSON format(based on pageIndex and pageSize).
3. Find the difference between the number of records returned and pageSize.
4. From the array of returned objects create another object till you reach the difference and append this object to your original array.
5. Bind your grid or whatever control with this array of objects.
6. Use window.setTimeinterval function to fetch the records and populate the grid repeatedly.

I would also like to suggest using jqGrid[^] It is extremely useful considering your scenario.

Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900