JavaScript validation function can attached to the checkbox control using VB.Net server side code very easily. The JavaScript client side code used in this sample has the functionality to validate the number of ASP.Net checkboxes selected by the user placed inside the GridView control. You can store the number of selected checkboxes in an ASP.Net HiddenField control and display the JavaScript alert message box if value of HiddenField exceeds the limit. Click event of checkbox control can be used to set the value in ASP.Net HiddenField control to validate the number of GridView checkbox selection.