简体   繁体   中英

Allow special characters for password

In my MVC2 site if a user enters lt/gt signs in a password box an exception is thrown because of "potentially dangerous..". ValidateInput(false) on my controller solves it but for something so simple (not html passing) yet needs to be protected what is a better alternative? I've briefly looked at http://wpl.codeplex.com/ but it also seems overkill

Thoughts? Your solution?

use Javascript onsubmit event and escap your inputs before posting it to the server. that will allow you to do what you want.

You can unescap the data at server side as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM