asp.net - ASP - TextBox accept only characters [UniCode] - C# -


i have textbox introduce text(three names). want textbox accept characters in unicode format!

this (wrong)code ascii format:

           if (!regex.ismatch(txtthreenames.text, "[a-za-z]^"))             {                 return "three names, must string !";             } 

try this:

public static bool isascii(this string value) {     // ascii encoding replaces non-ascii question marks, use utf8 see if multi-byte sequences there     return encoding.utf8.getbytecount(value) == value.length; } 

source: http://snipplr.com/view/35806/


Comments