[2005] ImageButton in Gridview
I am adding one image button in the Row Bound event of the Gridview as
Code:
ImageButton imgSortAssendingbyId = new ImageButton();
imgSortAssendingbyId.Click += new ImageClickEventHandler(this.imgSortAssendingbyId_Click);
private void imgSortAssendingbyId_Click(object sender, ImageClickEventArgs e)
{
}
The View source of the page is
PHP Code:
input type="image" name="grvResources$ctl01$ctl01" title="Sort Ascending" src="wv_sort_asc.gif" style="height:6px;border-width:0px;" />
But the click event is not firing :rolleyes:
I could not able to find the click event ?How to add the runat server property ?
Re: [2005] ImageButton in Gridview
Because the image is inside the Gridview, the event is raised but not as you specify it. You will need to handle the Gridview's RowCommand event. Give your ImageButton a CommandName and CommandArgument so that you can look at these in the GridView's RowCommand event.