如何在转发器中显示具有以下要求的项目? [英] How can I display items in repeater with the following requirement?

查看:63
本文介绍了如何在转发器中显示具有以下要求的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将列表作为转发器的数据源。

要求:

1.我必须显示五个项目,经过一段时间(假设为2秒)后,这些项目会自动替换为接下来的五个项目列表等等。 ....我怎么能这样做?



2.如果列表中的项目少于五个,我需要在剩下的位置重复这些项目。 />


示例:如果列表中只有三个项目,我需要在第四和第五个位置显示第一个和第二个项目。





html结构是这样的..

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


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





我的尝试:



HTML s结构如上所述。基于类,span标记的位置是固定的。



What I have tried:

HTML structure is like above. based on the class the position of span tag is fixed.

推荐答案

你可以帮忙解决这个问题:



ASP.NET - Ad Rotator [ ^ ]
You can take a help with this:

ASP.NET - Ad Rotator[^]


我会使用JavaScript / JQuery:



1.声明pageIndex(列表的当前页面)和pageSize(要显示的记录数)。

2.获取JSON格式的记录列表(基于pageIndex和pageSize)。

3.找到返回的记录数和pageSize之间的差异。

4.从数组中返回的对象创建另一个对象,直到找到差异并将此对象附加到原始数组。

5.用这个对象数组绑定网格或任何控件。

6使用window.setTimeinterval函数来f蚀刻记录并反复填充网格。



我还想建议使用jqGrid [ ^ ]考虑到你的情况,它非常有用。



希望这会有所帮助。
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.


这篇关于如何在转发器中显示具有以下要求的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆