求解 为什么设置不了 控件的属性
protected void IBtnOrderPrice_Command(object sender, CommandEventArgs e)
{
string name = e.CommandName;
DataListItem dli = (DataListItem)DL_GameCard.Controls[0];
System.Diagnostics.Debug.Assert(dli.ItemType == ListItemType.Header);
ImageButton orderprice = (ImageButton)dli.FindControl("IBtnOrderPrice");
ImageButton ordername = (ImageButton)dli.FindControl("IBtnOrderName");
switch (name)
{
case "Price"://升序
str_order = "DiscountPrice";
this.GameCardDataBind("", 1, Paging1.ItemsPerPage, str_order);
orderprice.CommandName = "Pricedesc";
orderprice.ImageUrl = "~/images/pricecion1.gif";
break;
case "Pricedesc"://降序
str_order = "DiscountPrice DESC";
this.GameCardDataBind("", 1, Paging1.ItemsPerPage, str_order);
orderprice.CommandName = "Price";
orderprice.ImageUrl = "~/images/pricecion.gif";
break;
case "Name"://升序
str_order = "Name";
ordername.CommandName = "Namedesc";
ordername.ImageUrl = "~/images/namecion1.gif";
this.GameCardDataBind("", 1, Paging1.ItemsPerPage, str_order);
break;
case "Namedesc"://降序
str_order = "Name DESC";
ordername.CommandName = "Name";
ordername.ImageUrl = "~/images/namecion.gif";
this.GameCardDataBind("", 1, Paging1.ItemsPerPage, str_order);
break;
default:
break;
}
}
我获取了DataList头部控件的值 但是 设置不了 为什么啊