我正在使用转发器来绑定数据和在标题模板上我正在使用 imagebutton 对列进行排序。
我的客户端代码:
<asp:Repeater runat="server" ID="RptClientDetails" OnItemDataBound="RptClientDetails_ItemDataBound">
<HeaderTemplate>
<table id="example" class="dynamicTable table table-striped table-bordered table-primary">
<thead>
<tr>
<th>
Client Name
<asp:ImageButton runat="server" ID="ImgbtnNameUp" ImageUrl="~/Images/BlackUp.png"
OnCommand="lbtnSortingAccending_Click" CommandArgument="Name" Height="15px" Width="20px" />
<asp:ImageButton runat="server" ID="ImgbtnNameUpDown" ImageUrl="~/Images/BlackDown.png"
OnCommand="lbtnSorting_Click" CommandArgument="Name" Height="15px" Width="20px" />
</th>
<th>
Total Balance Due
<asp:ImageButton runat="server" ID="ImgbtnTotalBalanceDueUp" ImageUrl="~/Images/BlackUp.png"
OnCommand="lbtnSortingAccending_Click" CommandArgument="TotalBalanceDue" Height="15px"
Width="20px" />
<asp:ImageButton runat="server" ID="ImgbtnTotalBalanceDueDown" ImageUrl="~/Images/BlackDown.png"
OnCommand="lbtnSorting_Click" CommandArgument="TotalBalanceDue" Height="15px"
Width="20px" />
</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
在 C# 代码上:
protected void lbtnSorting_Click(object sender, CommandEventArgs e)
{
string sortExpression = e.CommandArgument.ToString();
List<ARDTO> SirtlingListOBj = (List<ARDTO>)Session["GetClientList"];
int Showall = (int)Session["ShowAll"];
ImageButton imgBtnobj = new ImageButton();
imgBtnobj = (ImageButton)sender;
imgBtnobj.ImageUrl = "";
imgBtnobj.ImageUrl = "/Images/greenDown.png";
}
在这里我想更改 ImageURl ......但它不起作用......所以,任何人都可以在这里帮助我......
这里有什么问题?
或者我可以通过 css 更改它吗?