文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>repeater内嵌套下拉列表绑定数据.

repeater内嵌套下拉列表绑定数据.

时间:2011-03-12  来源:gooliugle

  protected void rptActiveCodesOfGame_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            DropDownList ddl = e.Item.FindControl("ddlSelectServer") as DropDownList;
            if (ddl != null)
            {
                List<GameActiveCodeInfo> tempList = new List<GameActiveCodeInfo>();
                GameActiveCodeInfo g = e.Item.DataItem as GameActiveCodeInfo;
                if (g != null) {
                    tempList = listAll.FindAll(x => x.GameId == g.GameId);
                    foreach (var x in tempList)
                    {
                        ddl.Items.Add(new ListItem(x.GameServerName, x.BatchId.ToString()));
                    }
                    ddl.Items[0].Selected = true;                    
                }

                HtmlAnchor a = e.Item.FindControl("aGetCode") as HtmlAnchor;
                if (a != null)
                {
                    a.Attributes["onclick"] = "GameActiveCode.GetGameActiveCode('" + g.GameShort + "','" + ddl.ClientID + "');";
                }
                DropDownList ddlist = e.Item.FindControl("ddlSelectServer") as DropDownList;
                if (ddlist != null)
                {
                    ddlist.Attributes["onchange"] = "GameActiveCode.GetActiveCodeDetail('" + ddl.ClientID + "','" + g.GameShort + "');";
                }                
            }
        }
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载