How to display "&" character in error description string for ErrorProvider


/ Published in: C#
Save to your folder(s)

To display "&" character within the string used as error descriptor in ErrorProvidor component in .NET use "&&&" so that it displays as a single "&".
More detail at:
http://www.codeproject.com/Messages/3225091/ErrorProvider-SetError-string-constraint.aspx


Copy this code and paste it in your HTML
  1. // "&&&" are displayed as "&" in error provider tool-tip
  2. string tempStr = "Some Name can not contain the characters: &&&,á,é,í,ó";
  3. this.mainErrorProvider.SetError(this.someNameTxtBox, tempStr);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.