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 + "');";
}
}
}
{
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 + "');";
}
}
}