I want to change imageurl which image button I click in datalist.So I must get a diffence propertie of imagebutton in datalist.My code is below;
If you just want a change your selected image url, first of all you must add CommandName your ImageButton element as a below.
<asp:ImageButton ID="imgbtncevaponayla" runat="server" CommandName="btnimgbtncevaponayla" ImageUrl="~/resimler/cevaponaybeyaz.jpg"/>
You find which button selected on your .aspx.cs file and you change that image url like that:
if (e.CommandName == "btnimgbtncevaponayla")
{
ImageButton btn = e.CommandSource as ImageButton;
btn.ImageUrl = "~/resimler/different.jpg";
}