简体   繁体   English

在MVC输入中允许电子邮件地址的特定格式

[英]Allowing the specific format of email address in MVC input

I have a page in MVC where i want to take the email adddress as the input which can be of format like:" Jone Davi" <jone@gmail.com> , " Ben Miller" <ben@gmail.com> , " Jane Ton" <jane@gmail.com> , 我在MVC中有一个页面,我想将电子邮件地址作为输入,其格式可以为:“ Jone Davi" <jone@gmail.com> ,“ Ben Miller" <ben@gmail.com> ,“ Jane Ton" <jane@gmail.com>

Then from this I want to parse the valid emailaddress.But on click of the submit button getting error message" A potentially dangerous Request.Form value was detected from the client " 然后,我要从中解析有效的电子邮件地址。但是,单击提交按钮后,出现错误消息“ 从客户端检测到潜在的危险Request.Form值”

Thus is there any way to take the input of email address in above format and bypass the security error for that specific page. 因此,有任何方法可以采用上述格式输入电子邮件地址并绕过该特定页面的安全错误。

Thanks in advance. 提前致谢。

You need to escape the angle-brackets. 您需要避开尖括号。 Use &lt; 使用&lt; and &gt; &gt; instead. 代替。

Check out this article for more details on escaping HTML in ASP.net MVC. 请查看本文,以获取有关在ASP.net MVC中转义HTML的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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