There are different mechanism for different controls for postback.
Above one will work for CheckBoxes, DropDownLists, LinkButtons, etc, this does not work for Button controls.
For button controls, If you take a look at how the server controls render as HTML, you'll see that the buttons do not call the __doPostBack Javascript function so the __EVENTTARGET is never set. Instead, the Buttons render as simple input type=“submit” tags.
Since the button (or input) is what causes the form to submit, it is added to the items in the Form collection, along with all the other values from the submitted form.
So you can find the postback control by the following method
public static Control GetPostBackControl(Page page)
{
Control control = null;
string ctrlname = page.Request.Params.Get("__EVENTTARGET");
if (ctrlname != null && ctrlname != string.Empty)
{
control = page.FindControl(ctrlname);
}
else
{
foreach (string ctl in page.Request.Form)
{
Control mycontrol = page.FindControl(ctl);
if (c is System.Web.UI.WebControls.Button)
{
control =mycontrol ;
break;
}
}
}
return control;
}
Hope this will solve your problem.