zoukankan      html  css  js  c++  java
  • Reaper自定义模板

    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Collections.Generic;

    namespace WebApplication1
    {
        public partial class _Default : System.Web.UI.Page
        {
            public class NumberLinkTemplate : ITemplate
            {

                #region ITemplate 成员

                public void InstantiateIn(Control container)
                {
                    LinkButton lb = new LinkButton();
                    lb.CommandName = "Index";
                    Literal lt = new Literal();
                    lt.Text = " ";
                    container.Controls.Add(lb);
                    container.Controls.Add(lt);
                    lb.DataBinding += new EventHandler(lb_DataBinding);
                }

                void lb_DataBinding(object sender, EventArgs e)
                {
                    LinkButton lbtn = (LinkButton)sender;
                    RepeaterItem container = (RepeaterItem)lbtn.NamingContainer;
                    lbtn.Text = container.DataItem.ToString();
                    lbtn.CommandArgument = container.DataItem.ToString();
                }

                #endregion
            }

            protected void Page_Load(object sender, EventArgs e)
            {
                List<string> linkNumberDataSource = new List<string>();
                for (int i = 1; i <= 10; i++)
                {
                    linkNumberDataSource.Add(i.ToString());
                }

                Repeater enterpriseRep = new Repeater();
                enterpriseRep.ItemTemplate = new NumberLinkTemplate();
                enterpriseRep.DataSource = linkNumberDataSource;
                enterpriseRep.DataBind();
                enterpriseRep.ItemCommand += new RepeaterCommandEventHandler(enterpriseRep_ItemCommand);
                this.Panel1.Controls.Add(enterpriseRep);
               
            }

            void enterpriseRep_ItemCommand(object source, RepeaterCommandEventArgs e)
            {
                Response.Write("CommandName:"+e.CommandName+"<br>"+"CommandArgument:"+e.CommandArgument);
            }
        }
    }

  • 相关阅读:
    whith ~ as 用法
    python函数 传参的多种方式 解读
    关于HTTP协议,一篇就够了
    appium+python自动化 adb shell按键操作
    貌似这个官网有api按,有空研究下
    切换了webview 定位不了的解决方法 (还没有试,记录在此)
    补充appium -api
    appium 点击物理按键
    修改最后一次 已commit 的备注
    场景记录
  • 原文地址:https://www.cnblogs.com/chenfulai/p/1353555.html
Copyright © 2011-2022 走看看