<asp:textbox id="TextBox1" runat="server" MaxLength="14" ></asp:textbox>
[WebMethod] public string HelloWorld(string input) { // you can throw new exception if (string.IsNullOrEmpty(input) || input.Length > 14) throw new ArgumentException("Invalid Input"); //Or you can limit the input without throwing exception if (string.IsNullOrEmpty(input) && input.Length > 14) input = input.Substring(0,14) // do something with input }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)