If
onclick
in your sample belongs the GridView, than
this
will be the GridView, so you can use
this.id
. Other option is use value from the server:
onclick="javascript:SelectheaderCheckboxes(<% GridView.ClientId %>)"
This will work even
onclick
not belongs to GridView...