sir i have a datalist and in item template there is a imagebutton.
i want to clicking image button and want to get id of this image..
but when i click image button error occured invalid postback or callback..
i also write a autopageevent="true" or false both but error occured plz help me..
Loading
Vijay YadavPosted Feb 7, 2012, 1:30 AM
You can call the Onclick function of the Imagebutton inside the datalist itemtemplate
For ex:
protected void image_Click(object sender, ImageClickEventArgs e)
{
ImageButton img = sender as ImageButton; //This will give you current row imagebutton
if (img != null)
{
DataListItem rp = img.NamingContainer as DataListItem;
if (rp != null)
{
//statement or operation you want to perform.
}
}
}