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:

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


RSS Icon Subscribe to comments

You need to login to post a comment.