<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Security</title><link>http://forums.asp.net/25.aspx</link><description>All about ASP.NET security (authentication, authorization, membership, roles, etc.) and the Login controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=24&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/3170832.aspx</link><pubDate>Mon, 18 May 2009 19:48:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3170832</guid><dc:creator>relish27</dc:creator><author>relish27</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3170832.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=3170832</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Have you had luck with this?&amp;nbsp; I am looking into doing this -- it also looks like this isn&amp;#39;t the only table that the email appears in.&amp;nbsp; Do you feel that this is a safe option?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2818861.aspx</link><pubDate>Thu, 18 Dec 2008 22:47:35 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2818861</guid><dc:creator>mfreeman</dc:creator><author>mfreeman</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2818861.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2818861</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;Scott W:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;For the CreateUserWizard control, you&amp;#39;ll need to template it and label the username textbox as email address. Then set an event handler for the CreatingUser event: 
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;void&lt;/font&gt; RegisterNewUser_CreatingUser(&lt;font color="#0000ff"&gt;object&lt;/font&gt; sender, System.&lt;font color="#008080"&gt;EventArgs&lt;/font&gt; e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#008080"&gt;CreateUserWizard&lt;/font&gt; cuw = (&lt;font color="#008080"&gt;CreateUserWizard&lt;/font&gt;)sender;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cuw.Email = cuw.UserName;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Then template your login control and set the label on the username textbox to email address, and put in a regex validation control to make sure they enter a valid email address.&lt;/font&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;This did the trick for me!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2434253.aspx</link><pubDate>Thu, 19 Jun 2008 15:40:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2434253</guid><dc:creator>Inno101</dc:creator><author>Inno101</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2434253.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2434253</wfw:commentRss><description>&lt;p&gt;of course, missed that&lt;/p&gt;
&lt;p&gt;I would like&amp;nbsp;to implement your solution to my site. It&amp;#39;s by far the most robust that has been suggested beyond creating a custom provider (why bother if you don&amp;#39;t have to!). Well done for your depth of thought.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m no expert though and would need some guidance. Would you be willing to give me a helping hand trying to get it rolling?&lt;/p&gt;
&lt;p&gt;Yours Hopefully,&lt;/p&gt;
&lt;p&gt;Mark&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2399011.aspx</link><pubDate>Tue, 03 Jun 2008 20:05:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2399011</guid><dc:creator>radmanmm</dc:creator><author>radmanmm</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2399011.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2399011</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;Inno101:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;HI Maybe i&amp;#39;ve missed something but what happens if you have two people with the same name?&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What does that matter?&amp;nbsp; The Guid will ensure uniqueness.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2398358.aspx</link><pubDate>Tue, 03 Jun 2008 16:15:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2398358</guid><dc:creator>Inno101</dc:creator><author>Inno101</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2398358.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2398358</wfw:commentRss><description>&lt;p&gt;HI Maybe i&amp;#39;ve missed something but what happens if you have two people with the same name?&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2325790.aspx</link><pubDate>Mon, 28 Apr 2008 19:00:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2325790</guid><dc:creator>radmanmm</dc:creator><author>radmanmm</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2325790.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2325790</wfw:commentRss><description>Ok Great.&lt;br /&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2325767.aspx</link><pubDate>Mon, 28 Apr 2008 18:53:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2325767</guid><dc:creator>cartch2008</dc:creator><author>cartch2008</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2325767.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2325767</wfw:commentRss><description>&lt;p&gt;radmanmm...can&amp;#39; you point me to where this might be?&amp;nbsp; I don&amp;#39;t see it&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;sorry, found it...&lt;font color="#ff0000" size="2"&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; 
&lt;p&gt;requiresUniqueEmail&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2305787.aspx</link><pubDate>Fri, 18 Apr 2008 04:19:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2305787</guid><dc:creator>kenmaster</dc:creator><author>kenmaster</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2305787.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2305787</wfw:commentRss><description>&lt;p&gt;HI there,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I tried to follow but I got into one of the problem that is my Email was duplicated. It turn out that the ASP_User table created 2 records for the same user. One for the membership and the other one for the profile. How can I solve this problem??&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks you all&lt;/p&gt;&lt;p&gt;&amp;nbsp;Ken&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2300103.aspx</link><pubDate>Tue, 15 Apr 2008 22:26:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2300103</guid><dc:creator>radmanmm</dc:creator><author>radmanmm</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2300103.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2300103</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;Darpa:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;radmanmm:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;u&gt;And finally in the PasswordRecovery control I added this code:&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;protected&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Page_Load(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;EventArgs&lt;/font&gt;&lt;font size="2"&gt; e)
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (Session[&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;] != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;) {
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; username = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Membership&lt;/font&gt;&lt;font size="2"&gt;.GetUserNameByEmail(Session[&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;].ToString());
&lt;p&gt;PasswordRecovery1.UserName = username;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Can you explain the purpose of the above section of code?&lt;/p&gt;&lt;p&gt;If someone goes to the password recovery page, after&amp;nbsp; logging out their username shows in the box.&amp;nbsp; and from the logic of your handling of the email as username, i don&amp;#39;t know what this section of code is supposed to do.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Darpa, this code was written quite a while ago for me, your best bet would be to wire it up and step through it.&amp;nbsp; Sorry.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;Darpa:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;radmanmm:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;protected&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; PasswordRecovery1_VerifyingUser(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;LoginCancelEventArgs&lt;/font&gt;&lt;font size="2"&gt; e) {
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; username = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Membership&lt;/font&gt;&lt;font size="2"&gt;.GetUserNameByEmail(PasswordRecovery1.UserName);&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;  &lt;b&gt;      &lt;span class="kwd"&gt;if&lt;/span&gt; (&lt;span class="kwd"&gt;string&lt;/span&gt;.IsNullOrEmpty(username))&lt;br /&gt;        {&lt;br /&gt;            lblWarning.Text = &lt;span class="st"&gt;&amp;quot;The submitted email does not exist&amp;quot;&lt;/span&gt;;&lt;br /&gt;            &lt;span class="kwd"&gt;return&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/pre&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;/pre&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (username != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;) {
&lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;//we have an email address&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;Session[&lt;font color="#800000" size="2"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;] = PasswordRecovery1.UserName;
&lt;p&gt;PasswordRecovery1.UserName = username;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;else&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (!&lt;/font&gt;&lt;font color="#008080" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;.IsNullOrEmpty(PasswordRecovery1.UserName)) {
&lt;p&gt;&lt;font color="#008000" size="2"&gt;//we have a userName&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font color="#008080" size="2"&gt;MembershipUser&lt;/font&gt;&lt;font size="2"&gt; user = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Membership&lt;/font&gt;&lt;font size="2"&gt;.GetUser(PasswordRecovery1.UserName);
&lt;p&gt;PasswordRecovery1.UserName = user.Email;&lt;/p&gt;
&lt;p&gt;Session[&lt;font color="#800000" size="2"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;] = user.Email;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;/div&gt;&lt;/BLOCKQUOTE&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You might also want to consider adding&amp;nbsp; this:&lt;/p&gt;&lt;pre class="coloredcode"&gt;        &lt;span class="kwd"&gt;if&lt;/span&gt; (&lt;span class="kwd"&gt;string&lt;/span&gt;.IsNullOrEmpty(username))
        {&lt;br /&gt;		// send a message to a blank warning label on the page
            WarningLabel.Text = &lt;span class="st"&gt;&amp;quot;The submitted email does not exist&amp;quot;&lt;/span&gt;;
            &lt;span class="kwd"&gt;return&lt;/span&gt;;
        }&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&amp;nbsp;to the password recovery, if someone enters their email in wrong or an email that doesn&amp;#39;t exist, an exception is thrown.&amp;nbsp;&lt;/pre&gt;&lt;p&gt;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This is true Darpa, you should ensure that you are trapping the logic.&amp;nbsp; again since this has been such a long time, I can only guess that it was not production ready when I posted it.&amp;nbsp; Thanks for the catch.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2300009.aspx</link><pubDate>Tue, 15 Apr 2008 21:00:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2300009</guid><dc:creator>Darpa</dc:creator><author>Darpa</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2300009.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2300009</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;radmanmm:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;u&gt;And finally in the PasswordRecovery control I added this code:&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;protected&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Page_Load(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;EventArgs&lt;/font&gt;&lt;font size="2"&gt; e)
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (Session[&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;] != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;) {
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; username = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Membership&lt;/font&gt;&lt;font size="2"&gt;.GetUserNameByEmail(Session[&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;].ToString());
&lt;p&gt;PasswordRecovery1.UserName = username;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Can you explain the purpose of the above section of code?&lt;/p&gt;&lt;p&gt;If someone goes to the password recovery page, after&amp;nbsp; logging out their username shows in the box.&amp;nbsp; and from the logic of your handling of the email as username, i don&amp;#39;t know what this section of code is supposed to do.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;radmanmm:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;protected&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; PasswordRecovery1_VerifyingUser(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;LoginCancelEventArgs&lt;/font&gt;&lt;font size="2"&gt; e) {
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; username = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Membership&lt;/font&gt;&lt;font size="2"&gt;.GetUserNameByEmail(PasswordRecovery1.UserName);&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;  &lt;b&gt;      &lt;span class="kwd"&gt;if&lt;/span&gt; (&lt;span class="kwd"&gt;string&lt;/span&gt;.IsNullOrEmpty(username))&lt;br /&gt;        {&lt;br /&gt;            lblWarning.Text = &lt;span class="st"&gt;&amp;quot;The submitted email does not exist&amp;quot;&lt;/span&gt;;&lt;br /&gt;            &lt;span class="kwd"&gt;return&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/pre&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;/pre&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (username != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;) {
&lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;//we have an email address&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;Session[&lt;font color="#800000" size="2"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;] = PasswordRecovery1.UserName;
&lt;p&gt;PasswordRecovery1.UserName = username;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;else&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (!&lt;/font&gt;&lt;font color="#008080" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;.IsNullOrEmpty(PasswordRecovery1.UserName)) {
&lt;p&gt;&lt;font color="#008000" size="2"&gt;//we have a userName&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font color="#008080" size="2"&gt;MembershipUser&lt;/font&gt;&lt;font size="2"&gt; user = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Membership&lt;/font&gt;&lt;font size="2"&gt;.GetUser(PasswordRecovery1.UserName);
&lt;p&gt;PasswordRecovery1.UserName = user.Email;&lt;/p&gt;
&lt;p&gt;Session[&lt;font color="#800000" size="2"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;] = user.Email;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;/div&gt;&lt;/BLOCKQUOTE&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You might also want to consider adding&amp;nbsp; this:&lt;/p&gt;&lt;pre class="coloredcode"&gt;        &lt;span class="kwd"&gt;if&lt;/span&gt; (&lt;span class="kwd"&gt;string&lt;/span&gt;.IsNullOrEmpty(username))
        {&lt;br /&gt;		// send a message to a blank warning label on the page
            WarningLabel.Text = &lt;span class="st"&gt;&amp;quot;The submitted email does not exist&amp;quot;&lt;/span&gt;;
            &lt;span class="kwd"&gt;return&lt;/span&gt;;
        }&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&amp;nbsp;to the password recovery, if someone enters their email in wrong or an email that doesn&amp;#39;t exist, an exception is thrown.&amp;nbsp;&lt;/pre&gt;&amp;nbsp; &lt;br /&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2267320.aspx</link><pubDate>Mon, 31 Mar 2008 21:23:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2267320</guid><dc:creator>radmanmm</dc:creator><author>radmanmm</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2267320.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2267320</wfw:commentRss><description>&lt;p&gt;the provider has an attribute for requiring unique emails.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/2266798.aspx</link><pubDate>Mon, 31 Mar 2008 16:56:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2266798</guid><dc:creator>cartch2008</dc:creator><author>cartch2008</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2266798.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2266798</wfw:commentRss><description>&lt;p&gt;How are you preventing the same email address from being used more than once?&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/1875429.aspx</link><pubDate>Fri, 24 Aug 2007 14:05:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1875429</guid><dc:creator>engwar</dc:creator><author>engwar</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1875429.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1875429</wfw:commentRss><description>&lt;p&gt;D&amp;#39;oh!&lt;/p&gt;&lt;p&gt;That was indeed the problem. Thanks.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;Again, thanks also for providing the code samples. Sure is a great solution!&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/1874546.aspx</link><pubDate>Fri, 24 Aug 2007 03:08:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1874546</guid><dc:creator>radmanmm</dc:creator><author>radmanmm</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1874546.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1874546</wfw:commentRss><description>&lt;p&gt;hmm... you do have the CreatingUser event bound to the object right?&lt;/p&gt;
&lt;p&gt;To check open the page in the designer, select the control and then view the events in the properties window.&amp;nbsp; Make sure you have the control bound to the CreatingUser event.&lt;/p&gt;</description></item><item><title>Re: Using Email as UserName</title><link>http://forums.asp.net/thread/1874533.aspx</link><pubDate>Fri, 24 Aug 2007 02:58:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1874533</guid><dc:creator>engwar</dc:creator><author>engwar</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1874533.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1874533</wfw:commentRss><description>&lt;p&gt;radmanmm,&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks for the great work. I&amp;#39;ve got this working 99%. I am able to log in using the email address instead of the custom user name. &lt;br /&gt;&lt;br /&gt;Two questions though regarding this section of code...&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="kwd"&gt;protected void&lt;/span&gt; CreateUserWizard1_CreatingUser(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, LoginCancelEventArgs e) {&lt;br /&gt;&lt;br /&gt;CreateUserWizard1.UserName = &lt;span class="kwd"&gt;this&lt;/span&gt;.firstName.Text + &lt;span class="st"&gt;&amp;quot;.&amp;quot;&lt;/span&gt; + &lt;span class="kwd"&gt;this&lt;/span&gt;.lastName.Text + &lt;span class="st"&gt;&amp;quot;.&amp;quot;&lt;/span&gt; + Guid.NewGuid().ToString();&lt;br /&gt;&lt;br /&gt;}&lt;/b&gt;&lt;/b&gt;&lt;/pre&gt;&lt;p&gt;1) I get the following error with the above code when compiling &lt;/p&gt;&lt;p&gt;&amp;#39;&lt;b&gt;Register&amp;#39; does not contain a definition for &amp;#39;firstName&lt;/b&gt;&amp;#39; &lt;/p&gt;&lt;p&gt;I can compile by replacing it with the following line... &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;b&gt;&lt;b&gt;CreateUserWizard1.UserName =&lt;/b&gt;&lt;/b&gt;&lt;b&gt;&lt;b&gt;Guid.NewGuid().ToString();&lt;/b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Which is fine because the UserName can simply be a Guid. But the real problem is that this code is never reached anyway.&amp;nbsp; For debugging I put a breakpoint
at this line. And my app never stops at this point while debugging. &lt;/p&gt;&lt;p&gt;If the UserName field is visible on the registration page the registration is successful. However the username is set to whatever the user typed in. If I set the visible property of the UserName textbox control to &amp;quot;false&amp;quot; hoping to set this value in the CreateUserWizard1_CreatingUser event my registration is unsuccessful and I get the following error message &lt;/p&gt;&lt;p&gt;&lt;b&gt;Your account was not created. Please try again.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;m sure I&amp;#39;m missing something easy here. But why doesn&amp;#39;t CreateUserWizard1_CreatingUser fire like I expect? &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>