Here is example of calling a JavaScript method that handles key press event. I also included the JavaScript method, below.
Inside of the GridView column:
<asp:TemplateField HeaderText="Doses Received" FooterStyle-Width="70px" HeaderStyle-Wrap="true" ItemStyle-Width="70px">
<ItemTemplate>
<asp:TextBox ID="txtDosesReceived" runat="server" onkeypress="return NoCommaAllowed(event);" MaxLength="10" Width="70px"
Text='<%# Bind("DosesReceived") %>'></asp:TextBox>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
JS Method:
<pre lang="cs">function NoCommaAllowed(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode
return !(charCode == 44);
}</pre>