参数'username'不能包含逗号。参数名称:用户名 [英] The parameter 'username' must not contain commas. Parameter name: username
问题描述
我正在使用asp.net memebrlogin_control并获取异常参数username不能包含逗号。参数name:username。我在这个
I am using asp.net memebrlogin_control and getting exception "The parameter 'username' must not contain commas. Parameter name: username". I am using emailID as username in this
中使用emailID作为用户名如何删除此错误,我也想知道什么是不允许验证的字符列表
How can I remove this error, and I would also like to know that what is the list of characters that should be disallowed to validate email address.
推荐答案
阅读 RFC 2822 完整的电子邮件地址语法。如果您通过BNF工作,您会看到@,@@ foo.bar
是非常好的,如果不寻常。您要求的规则可以在第3.2.4节找到:
Read RFC 2822 for the complete email address syntax. If you work through the BNF, you'll see that "@,@"@foo.bar
is perfectly fine, if unusual. The rule you're asking for, though, can be found at section 3.2.4:
atext = ALPHA / DIGIT / ; Any character except controls,
"!" / "#" / ; SP, and specials.
"$" / "%" / ; Used for atoms
"&" / "'" /
"*" / "+" /
"-" / "/" /
"=" / "?" /
"^" / "_" /
"`" / "{" /
"|" / "}" /
"~"
atom = [CFWS] 1*atext [CFWS]
dot-atom = [CFWS] dot-atom-text [CFWS]
dot-atom-text = 1*atext *("." 1*atext)
和第3.4.1节:
addr-spec = local-part "@" domain
local-part = dot-atom / quoted-string / obs-local-part
domain = dot-atom / domain-literal / obs-domain
如果忽略 dot-atom
c $ c> local-part 和 domain
规则,您将匹配常用或花园地址。可能您的asp.net控件不接受所有有效的RFC2822地址,因此您应该检查该文档。
If you ignore everything but dot-atom
in the local-part
and domain
rules, you'll match the common-or-garden addresses. It's possible that your asp.net control doesn't accept all valid RFC2822 addresses, so you should really check that documentation.
您可能会执行类似于%< ;&十六进制编码gt;中将有效(或不是)电子邮件地址转换为您的控件可以接受的用户名参数的技巧。
You might do something similar to the "%<hexcode>" trick to convert a valid (or not) email address into a username argument that your control can accept.
(从O'掌握正则表达式 Reilly曾经有一个庞大的一页正则表达式(大多数是正确的)邮件地址,但它已经在第3版)。
(Mastering Regular Expressions from O'Reilly used to have a humongous one-page regex (mostly correct) for mail addresses, but it's gone in 3rd ed.)
这篇关于参数'username'不能包含逗号。参数名称:用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!