I'm adding an image button as an html element like a string in a gridview using JQuery. Grid view is populating correctly with all the value and this delete button. But when clicking on delete button, the ID passing to button click event is empty. I believe it's something to do with the string formation (may be quotes are misplaced) specially in the part CommandArgument='<%# Eval("ID") %>'. Can someone help me to verify the html element string I created is correct?
//string which is added to grid view row for image button
var stringVal ='<asp:ImageButton ID="remove" runat="server" ImageUrl ="~/images/delete.gif" HeaderText="Image" OnCommand= "RemoveOneByOne_Click" CommandName="deleteOneByOne" CommandArgument='<%# Eval("ID") %>'/>';
//button click event where CommandArgument coming as empty
protected void RemoveOneByOne_Click(object sender, CommandEventArgs e)
{
if (e.CommandName == "deleteOneByOne")
{
string ID = e.CommandArgument.ToString();
}
}