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

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -