ASP.NET的ListView:如何插入"特别"每个项目的N个项目? [英] ASP.NET ListView: how to insert "particular" item each N items?

查看:164
本文介绍了ASP.NET的ListView:如何插入"特别"每个项目的N个项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个奇怪的事情与asp.net ListView控件。

i would like to do a "weird" thing with the asp.net listview control.

我想插入广告列表视图的每8-10项(与数据库表databounded):例如每8-10项插入谷歌的Adwords的JScript code

I would like to insert advertising each 8-10 item of the listview (databounded with a database table) : for example each 8-10 item insert the google adwords jscript code.

我googoled,但我没有发现任何东西。
有人知道这是否是可能的告诉列表视图:每8个项目,显示这个项目(谷歌的JScript code)

I've googoled but i haven't found anything. Someone know if it's possible to "tell the listview: each 8 items, show this item (google jscript code).

对不起我那可怜的英语。
希望加以解释,谢谢!

Excuse me for my poor english. Hope to be explained, thanks!

推荐答案

您可以实现通过分组您的项目这种效果。你需要以下内容:

You can achieve this effect by grouping your items. You'll need the following:


  • 在您的ListView一个LayoutTemplate模板包含groupPlaceholder

  • 在您的ListView一个GroupTemplate包含itemPlaceholder

  • 包含广告的东西一GroupSeparatorTemplate

  • 包含数据绑定的东西一个ItemTemplate

然后,您可以将您GROUPSIZE设置为任何你想要的和ASP.Net会自动插入各组之间的分隔符。

then, you can set your GroupSize to whatever you want and ASP.Net will automatically insert a separator between each group.

这篇关于ASP.NET的ListView:如何插入"特别"每个项目的N个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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