c# - How to restrict user from entering specific chars (xml invalid characters) in textbox? -


i have problem textbox. user enters text/string in textbox , string exported value of attribute in xml file. there way how can disable user enter (type+paste) forbidden (for xml format) characters, symbol euro €?

instead of restricting user can filter out characters don't want before passing xml.

string texttopass = replaceinvalidcharacters(yourtextbox.text);   public string replaceinvalidcharacters(string toreplace) {    toreplace = toreplace.replace("€","");    //similarly others unwanted characters     return toreplace; } 

Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -