Within my GridView, there is a column that contains a textbox:
<asp:GridView style="width:75%;float:left"
ID="gvPieceOutturns"
ShowHeaderWhenEmpty="false"
CssClass="tblResults"
runat="server"
OnRowDataBound="gvPieceOutturns_ItemDataBound"
DataKeyField="ID"
AutoGenerateColumns="false"
allowpaging="false"" />
<Columns>
<asp:TemplateField HeaderText="Comment" SortExpression="MemComment">
<ItemTemplate>
<asp:TextBox ID="txtMemComment" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
My goal is to validate the textbox so that it only allows letters and numbers, and not characters like full stops or commas.
When the user tabs off the textbox, a function is triggered:
protected void UpdateMemOutturnComment(object sender, EventArgs e)
{
string Comment = hfMemOutturnComment.Value;
}
I am wondering how I can notify the user if they input an invalid character. Should I alert them right away or wait until they finish filling in the textbox?