| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 
 |  
 
    public partial class _Default : System.Web.UI.Page
    {
        public class Teste
        {
            public string Path { get; set; }
            public string ID { get; set; }
        }
        public List<Teste> m = new List<Teste>()
            {
                new Teste() { Path = "833566997.gif" },
                new Teste() { Path = "Asynchronous file copy.png" }
            };
        public List<Teste> m1 = new List<Teste>()
            {
                new Teste() { Path = "mima.jpg"},
                new Teste() { Path = "Asynchronous file copy.png" }
            };
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.Repeater1.DataSource = null;
            this.Repeater1.DataBind();
 
            switch (Convert.ToInt32(this.DropDownList1.SelectedValue))
            {
                case 1:
                    this.Repeater1.DataSource = m.AsEnumerable();
                    this.Repeater1.DataBind();
                    break;
                case 2:
                    this.Repeater1.DataSource = m1.AsEnumerable();
                    this.Repeater1.DataBind();
                    break;
                default:
                    break;
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            foreach (RepeaterItem item in this.Repeater1.Items)
            {
                item.Controls.OfType<RouteInnCheckBox>().ToList()
                    .ForEach(c =>
                        {
                            if (c.Checked)
                                this.Literal1.Text += c.Path + " <br />";
                        });
            }
        }
    } |