前台代码:
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div style="width: 350px; float: left;">
<asp:Literal ID="litVideo" runat="server"></asp:Literal><br />
<asp:Repeater runat="server" ID="rptVideoName" OnItemDataBound="rptVideoName_ItemDataBound" OnItemCommand="rptVideoName_ItemCommand">
<ItemTemplate>
<asp:LinkButton ID="lbVideoName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Title")%>' CommandName="PlayVideo" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID")%>'></asp:LinkButton>
</ItemTemplate>
</asp:Repeater>
</div>
</ContentTemplate>
</asp:UpdatePanel>

后台代码:

//绑定repeater的个数,每行3个

protected void rptCategories_ItemDataBound(object src, RepeaterItemEventArgs e)
{
// Add <tr> for change row
if ((e.Item.ItemIndex + 1) % 3 == 0)
{
e.Item.Controls.Add(new LiteralControl("</tr><tr>"));
}
}

//repeater相应单击事件

protected void rptVideoName_ItemCommand(object sender, RepeaterCommandEventArgs e)
{
if (e.CommandName == "PlayVideo")
{
BindVideoName();
SPQuery query = new SPQuery();
SPList list = SPContext.Current.Web.Lists[ListNames.CompanyPublicityVideo];
SPListItem item = (new SharePointService()).GetItem(list, int.Parse(e.CommandArgument.ToString()));
this.litVideo.Text = PlayVideo(item.Folder, "autoplay=''");
}
}

设置repeater每行多少个的方法的更多相关文章

  1. shell实例浅谈之六文件特定行打印的多种方法

    一.问题 Sed和AWK在处理文件方面有很强的优势,还有head和tail等文件处理工具的使用,grep也可实现文本的搜索.上述命令都可以在后面直接加文件名,不需要在前面使用cat添加管道,cat会影 ...

  2. dll被设置为用记事本打开的解决方法

    dll被设置为用记事本打开的解决方法: 打开注册表编辑器 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Fi ...

  3. 使用命令行执行jmeter的方法

    1. 简介 使用非 GUI 模式,即命令行模式运行 JMeter 测试脚本能够大大缩减所需要的系统资 本文介绍windows下以命令行模式运行的方法. 1.1. 命令介绍 jmeter -n -t & ...

  4. 3dsmax不同版本 pyside qt UI 设置max窗口为父窗口的方法

    3dsmax不同版本 pyside qt widget 设置 max 窗口为父窗口的方法 前言: 3dsmax 在 2014 extension 之后开始集成 Python 和 PySide,但是在版 ...

  5. Latex: 设置 threeparttable footnote 行宽度

    参考: Table width with threeparttable smaller than notes and caption? Latex: 设置 threeparttable footnot ...

  6. 用NPOI创建Excel、合并单元格、设置单元格样式、边框的方法

    本篇文章小编为大家介绍,用NPOI创建Excel.合并单元格.设置单元格样式.边框的方法.需要的朋友参考下 今天在做项目中,遇到使用代码生成具有一定样式的Excel,找了很多资料,最后终于解决了,Ex ...

  7. 在MySQL中设置事务隔离级别有2种方法:

    在MySQL中设置事务隔离级别有2种方法: 1 在my.cnf中设置,在mysqld选项中如下设置 [mysqld] transaction-isolation = READ-COMMITTED 2 ...

  8. 实现span设置宽度(行内元素本来不支持调宽度高度这些样式)(变成行内块元素:display:inline-block;)

    实现span设置宽度(行内元素本来不支持调宽度高度这些样式)(变成行内块元素:display:inline-block;) 一.总结 1.将span从行内元素变成行内快元素就可以调了: 设置样式的时候 ...

  9. jqGrid行编辑配置,方法,事件

    行编辑可以在行修改后更新数据,如下图所示 用户用鼠标点击选择一行,jqGrid将可编辑的字段转换为数据输入单元,如上面图所示.不可编辑的列,如id,不会转为可输入单元,而是保持不变.可以通过配置col ...

随机推荐

  1. 使用Spring MVC 的表单控制器SimpleFormController

    以注册过程为例,我们可能会选择继承AbstractController来实现表单的显示,继承AbstractCommandController来实现表单的处理 ,这样是可行的,但必须要维护两个控制器 ...

  2. 【翻译】Selenium IDE v1.0.11 支持转换格式吗?

    原文: http://blog.reallysimplethoughts.com/2011/06/10/does-selenium-ide-v1-0-11-support-changing-forma ...

  3. 如何组建理想SOA团队

    趋向采用 SOA 软件开发领域的主要发展趋势是从传统软件体系结构过渡到面向服务的体系结构 (SOA).在传统软件体系结构中,将项目视为单个新应用程序的交付.在SOA中,将项目视为集成服务的交付——一些 ...

  4. 【HTML】Beginner9:Form

    1.Form     Collect data inputted by a user.     Used as an interface for a web application,or send d ...

  5. NOIP2015 提高组(senior) 解题报告

    过了这么久才来发解题报告,蒟蒻实在惭愧 /w\ Day1 T1 [思路] 模拟 [代码] #include<iostream> #include<cstring> #inclu ...

  6. HW5.21

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. HW5.3

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  8. VC++从入门到精通视频教程网址

    视频教程网址:http://www.pconline.com.cn/pcedu/empolder/gj/vc/0607/820674.html

  9. Notepad++中的颜色属性大全

    Indent guideline style  缩进参考线的颜色 Brace highlight style 鼠标指针在框架左右时框架的颜色(如css中{}   js中的()) Bad brace c ...

  10. Delphi- DLL操作

    动态链接库(Dynamic Link Library)是一个可以执行的并可以被多个Windows应用程序共享的程序模块(Module).模块中包含代码.数据和资源. 动态链接库的优点:不用重复编译和链 ...