1.Is ASP.NET the code behind normally is linked with an existing ASPX control, so for a button you should use an ASPX button like in the next example:
<asp:Button ID="_cancelButton" runat="server" autopostback="False" Width="80px" Text="Cancel" OnClientClick='OnCancel();' />
2.For your case, I recommend to use
ASP.NET AJAX Control Toolkit
. You could see an example of using it in my next article:
Advanced ASPX GridView Pagination and Data Entities[
^]. The provided code, from my article, could be extended for a real application and I provided also guiding steps for doing this.