c# - Get GridView Object from Sender -
i have multiple gridview
on page, , pagable. need handle paging in onpageindexchanging
event, i'd rather not write same code each gridview
.
so how can gridview object id sender? i'm trying following....
protected void pageindexchanging(object sender, gridviewpageeventargs e) { gridview gridview = (gridview)sender.id; gridview.pageindex = e.newpageindex; gridview.databind(); }
this way call same event handler gridviews , not have write new handler each one? i'm not sure how id of gridview
firing event :(
any appreciated!
it's simpler:
gridview gridview = (gridview)sender;
the sender
argument control triggered event.