Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The value "<" is not valid in an attribute on PasswordBox control

While creating a WPF application which includes a PasswordBox control, I tried to set the PasswordChar to display '<' instead of '*'. I wrote the following code:

<PasswordBox PasswordChar="<"></PasswordBox>

When using this code, the following error is reported:

Error 1 The value "<" is not valid in an attribute.

like image 757
Alias Varghese Avatar asked Jun 29 '15 11:06

Alias Varghese


1 Answers

Use this instead:

<PasswordBox PasswordChar="&lt;"></PasswordBox>

You'll find a comprehensive list of symbols and how to write them in XAML in this MSDN article: XML Character Entities and XAML

like image 81
almulo Avatar answered Oct 11 '22 13:10

almulo