<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Implement the Registration Verification Pattern</title><link>http://asp.net</link><pubDate>Mon, 25 Jun 2012 22:43:55 GMT</pubDate><generator>umbraco</generator><description>Comments for Implement the Registration Verification Pattern</description><language>en</language><atom:link href="http://asp.net/rss/comments/33743" rel="self" type="application/rss+xml" /><item><title>Comment Posted by ravindradonkada21</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Tue, 03 Aug 2010 03:34:17 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009728</guid><description><![CDATA[ <p>Hi,</p><p>   I have a problem with the Printer configuration through ASP.net code.</p><p>It is working on my local system but it could not pick up the printer name in the remote system. </p><p></p><p>I am getting the message -- your printer is not configured.</p><p></p><p>Working fine on my local system,but its not working on remote system.</p><p>Infact default printer was set on the remote system.</p><p>Please find the code</p><p></p><p>protected void imgBtnPrint_Click(object sender, ImageClickEventArgs e)</p><p>        {</p><p>            StringBuilder printerName = new StringBuilder();</p><p>            printerName.Append(@&quot;\\&quot;);</p><p>            try</p><p>            {</p><p>                if (HasPrinter())</p><p>                {</p><p>                    int maxPages = 0;</p><p></p><p>                    maxPages = Convert.ToInt32(ConfigurationManager.AppSettings[&quot;GISReportMaxNoOfPagesForPrint&quot;].ToString());</p><p>                    SetDatabaseLogonForReport();</p><p>                    CrystalReportViewer1.SeparatePages = false;</p><p></p><p>                    if (Session[&quot;PrinterName&quot;] != null)</p><p>                    {</p><p>                        crReport.PrintOptions.PrinterName = Session[&quot;PrinterName&quot;].ToString();</p><p>                    }</p><p>                    crReport.PrintToPrinter(1, true, 1, maxPages);                </p><p>                    //string StrWindow = &quot;&quot;;</p><p>                    //StrWindow += &quot;&lt;Script language=javascript&gt;&quot;;</p><p>                    //StrWindow += &quot;window.print();&quot;;</p><p>                    //StrWindow += &quot;&lt;/Script&gt;&quot;;</p><p>                    //Response.Write(StrWindow);</p><p></p><p>                }</p><p>                else</p><p>                {</p><p>                    lblMsg.ForeColor = System.Drawing.Color.Red;</p><p>                    lblMsg.Text = &quot;Your System is not configured with any Printer. Please Configure and Print the Report&quot;;</p><p>                }</p><p>            }</p><p>            catch (Exception ex)</p><p>            {</p><p>                Common.CatchError(ex, &quot;GISReportViewer:imgBtnPrint_Click&quot;);</p><p>                lblMsg.ForeColor = System.Drawing.Color.Red;</p><p>                //lblMsg.ForeColor = System.Drawing.Color.Red;</p><p>                //lblMsg.Text = &quot;Your System is not configured with any Printer. Please Configure and Print the Report&quot;;</p><p>            }</p><p>        }</p><p></p><p></p><p></p><p>private bool HasPrinter()</p><p>        {</p><p>            bool retValue = default(bool);</p><p>            string printerName = string.Empty;</p><p>            string searchQuery = &quot;SELECT * FROM Win32_Printer where default =true&quot;;</p><p></p><p>            // For Default printer</p><p>            // searchQuery =&quot;SELECT * FROM Win32_Printer where default =true&quot;;</p><p></p><p>            // Select Printers from WMI Object Collections</p><p>            ManagementObjectSearcher searchPrinters = new ManagementObjectSearcher(searchQuery);</p><p>            ManagementObjectCollection printerCollection = searchPrinters.Get();</p><p></p><p>            //Checking for the printerName in the PrinterCollection</p><p>            foreach (ManagementObject printer in printerCollection)</p><p>            {</p><p>                alPrinter.Add(printer.Properties[&quot;Name&quot;].Value.ToString().ToLower());</p><p>            }</p><p></p><p>            foreach (string s in alPrinter)</p><p>            {</p><p>                if (!s.Contains(&quot;microsoft xps document writer&quot;))</p><p>                {</p><p>                if (!s.Contains(&quot;adobe pdf&quot;))</p><p>                {</p><p>                Session[&quot;PrinterName&quot;] = s;</p><p>                retValue = true;</p><p>                }</p><p>                }</p><p>            }</p><p></p><p></p><p>            //printerCollection.Dispose();</p><p>            Session[&quot;PrinterName&quot;] = &quot;GIS - Fay House 290 - SHARP MX-M450N PCL6 on PRINTS&quot;;</p><p>            //return retValue;</p><p>            return true;</p><p>        }</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/ravindradonkada21.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by DotNet-Step1</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Tue, 03 Aug 2010 11:37:30 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009731</guid><description><![CDATA[ <p>Very helpful video.  Would you be able to do a follow up video on how to encrypt/decrypt the activation link?  This would be so that the GUID is not exposed.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/DotNet-Step1.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by sukumarraju</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Sun, 08 Aug 2010 07:23:05 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009795</guid><description><![CDATA[ <p>There is no download link for source code downloading. Would be useful to download the source code and reuse.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/sukumarraju.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by guinness.net</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Wed, 25 Aug 2010 21:48:06 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009989</guid><description><![CDATA[ <p>Thanks for another extremely useful video Joe.</p><p>Would love to see the VB source code. </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/guinness.net.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by benhayat</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Mon, 06 Sep 2010 19:15:51 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010140</guid><description><![CDATA[ <p>Joe, would it be possible to provide the source to the last three videos?</p><p></p><p>Secondly, towards the end, when you clicked to &quot;Create User&quot;, why were you logged in &quot;Immediately&quot;? I thought you set that in not to log you until you have been approved. How come it didn&#39;t work?</p><p>Thanks!</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/benhayat.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by calypso1481</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Fri, 01 Oct 2010 11:00:41 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010465</guid><description><![CDATA[ <p>Is there a downloadable file for this in VB.net?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/calypso1481.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pierredemontreal</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Fri, 08 Oct 2010 09:36:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010553</guid><description><![CDATA[ <p>Here is the code in C# but I can&#39;t make it work under the LOCAL DEVELOPMENT SERVER if you know how please add a comment.</p><p></p><p>I think I will loose all the indentations in this code, this box is not designed to show source code. Sorry about that.</p><p></p><p>1 - In Register.aspx</p><p></p><p>	- Modify:</p><p>	    &lt;asp:CreateUserWizard ID=&quot;RegisterUser&quot; runat=&quot;server&quot; EnableViewState=&quot;false&quot; OnCreatedUser=&quot;RegisterUser_CreatedUser&quot;&gt;</p><p>	  to</p><p>	    &lt;asp:CreateUserWizard ID=&quot;RegisterUser&quot; runat=&quot;server&quot; EnableViewState=&quot;false&quot; </p><p>            DisableCreateUser=&quot;True&quot; </p><p>            LogInCreateUser=&quot;false&quot;</p><p>            OnCreatedUser=&quot;RegisterUser_CreatedUser&quot;&gt;</p><p>    </p><p>	</p><p>2 - In Web.Config</p><p>    PROBLEM WITH THE &#39;LOCAL DEVELOPMENT SERVER&#39; I DON&#39;T KNOW THE SETTINGS OR IF IT CAN WORK WITH THE DEVELOPMENT SERVER.</p><p>    </p><p>  &lt;/system.web&gt;  NOT &lt;system.web&gt; check the slash before system.web</p><p>    &lt;system.net&gt;</p><p>      &lt;mailSettings&gt;</p><p>        &lt;smtp&gt;</p><p>          &lt;network </p><p>            host=&quot;mail.joestagner.com&quot; </p><p>            port=&quot;2525&quot; </p><p>            userName=&quot;UserName.JoeStagner.com&quot; </p><p>            password=&quot;password&quot;/&gt;</p><p>        &lt;/smtp&gt;</p><p>      &lt;/mailSettings&gt;</p><p>    &lt;/system.net&gt;</p><p></p><p>3 - Create a new folder named: &quot;EmailsTemplates&quot;</p><p>  - Add a new file named: &quot;VerifyNewUser.txt&quot;</p><p>  - Enter this test in the file</p><p></p><p>	Hello &lt;%Username%&gt;,</p><p></p><p>	Welcome abord.&lt;br /&gt;&lt;br /&gt;</p><p></p><p>	Your new account is almost ready, but before you can log in you must first [ &lt;a href=&quot;&lt;%VerificationURL%&gt;&quot; CLICK HERE TO VERIFY YOUR ACCOUNT.&lt;/a&gt; ]&lt;br /&gt;&lt;br /&gt;</p><p></p><p>	Once you have visited the verification URL you will redirected to the login page.</p><p></p><p>	If you have any problems or questions, please reply to this email.&lt;br /&gt;&lt;br /&gt;</p><p></p><p>	Thanks.</p><p></p><p>	4 - In Register.aspx.cs</p><p>	  - Add </p><p>	    using System.Net.Mail;</p><p>		using System.IO;</p><p></p><p>		Add in  protected void RegisterUser_CreatedUser(object sender, EventArgs e)</p><p>		{</p><p>		  MembershipUser newUser = Membership.GetUser(RegisterUser.UserName);</p><p>		  Guid newUserId = (Guid)newUser.ProviderUserKey;</p><p>		  string urlBase = Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath;</p><p>          string verifyUrl = &quot;VerifyNewUser.aspx?Id=&quot; + newUserId.ToString();</p><p>          string fullPath = urlBase + verifyUrl;</p><p>          string AppPath = Request.PhysicalApplicationPath;</p><p>          StreamReader sr = new StreamReader(AppPath + &quot;EmailsTemplates/VerifyNewUser.txt&quot;);</p><p></p><p>          MailMessage message = new MailMessage();</p><p>          message.IsBodyHtml = true;</p><p>          message.From = new MailAddress(&quot;Joe.Stagner@Microsoft.com&quot;);</p><p>          message.To.Add(new MailAddress(RegisterUser.Email));</p><p>          message.CC.Add(new MailAddress(&quot;Joe.Stagner@Microsoft.com&quot;));</p><p>          message.Subject = &quot;New User registration !&quot;;</p><p></p><p>          message.Body = sr.ReadToEnd();</p><p>          sr.Close();</p><p></p><p>          message.Body = message.Body.Replace(&quot;&lt;%Username%&gt;&quot;, RegisterUser.UserName);</p><p>          message.Body = message.Body.Replace(&quot;&lt;%VerificationURL%&gt;&quot;, fullPath);</p><p></p><p>          SmtpClient client = new SmtpClient();</p><p>          client.Send(message);</p><p>		</p><p>		</p><p>		... </p><p>		}</p><p></p><p></p><p>		5 - Add a WinForm Page &quot;VerifyNewUser.aspx&quot; with Masterpage checkbox set.</p><p></p><p></p><p>		6 - In  &quot;VerifyNewUser.aspx.cs&quot; </p><p>		  - Add using System.Web.Security;</p><p>		  - Add in </p><p>		  protected void Page_Load(object sender, EventArgs e)</p><p>		  </p><p>		  if(string.IsNullOrEmpty(Request.QueryString[&quot;ID&quot;]))</p><p>          {</p><p>            VerificationMessageLabel.Text = &quot;No Id whas specified ...&quot;;</p><p>          }</p><p>          else</p><p>          {</p><p>            Guid userId;</p><p>            try</p><p>            {</p><p>                userId = new Guid(Request.QueryString[&quot;ID&quot;]);</p><p>            }</p><p>            catch</p><p>            {</p><p>                VerificationMessageLabel.Text = &quot;The User Id specified is not in the proper format...&quot;;</p><p>                return;</p><p>            }</p><p></p><p>            MembershipUser usr = Membership.GetUser(userId);</p><p>            if (usr == null) </p><p>            {</p><p>                VerificationMessageLabel.Text = &quot;No corresponding user account could be found ...&quot;;</p><p>            }</p><p>            else if (usr.IsApproved == true)</p><p>            {</p><p>                VerificationMessageLabel.Text = &quot;The specified user account was previously activated ...&quot;;</p><p>            }</p><p>            else</p><p>            {</p><p>                usr.IsApproved = true;</p><p>                Membership.UpdateUser(usr);</p><p>                VerificationMessageLabel.Text = &quot;Your Account Has Been Approved !!!&quot;;</p><p></p><p>            }</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/pierredemontreal.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by simonbarnett</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Wed, 16 Feb 2011 11:39:41 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012088</guid><description><![CDATA[ <p>Hi</p><p></p><p>Great video - I have it working.  Only thing is the new user is automatically logged in even though I have LoginCreatedUser set to false.</p><p></p><p>I can&#39;t figure why - can you help? </p><p></p><p>Thanks</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/simonbarnett.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by habdulrauf</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Tue, 22 Feb 2011 23:40:25 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012190</guid><description><![CDATA[ <p>Email template file</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/habdulrauf.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by march11</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Fri, 22 Jul 2011 14:12:34 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013812</guid><description><![CDATA[ <p>Is this available in VB tutorial?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/march11.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ajingar</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Wed, 03 Aug 2011 06:50:13 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013894</guid><description><![CDATA[ <p><a rel="nofollow" href="http://localhost:3861/JingarWebDesignVerifyNewUser.aspx?ID=871094b5-a1f2-4439-95d1-62eebd1ad19a" target="_blank">localhost</a></p><p></p><p></p><p>Hi Joe, this is a very useful video. Thanks!</p><p></p><p>However, I am getting the same issue as SimonBarnett, i.e. the user is automatically logged in, although LoginCreatedUser=&quot;false&quot;.</p><p></p><p>Also, I noticed that the Verification link in the email that is sent didn&#39;t work initially. Then I realised there was a minor error in the code,</p><p>where there is a &quot;/&quot; missing in front of the VerifyNewUser.aspx (within Register.aspx.cs). So it should be like this:</p><p></p><p>string verifyUrl = &quot;/VerifyNewUser.aspx?ID=&quot; + newUserId.ToString();</p><p></p><p>Now it works fine thanks!!!</p><p></p><p>If you have any ideas about the user being automatically logged in, please let me know.</p><p></p><p>Much Obliged.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ajingar.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by yemo1</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Thu, 18 Aug 2011 17:39:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013989</guid><description><![CDATA[ <p>Hi Joe,</p><p>Your tutorials have been always helpful and easy to implement.</p><p>Keep up the good job.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/yemo1.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by acheo</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Thu, 22 Mar 2012 09:48:04 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015179</guid><description><![CDATA[ <p>Hi Joe,</p><p></p><p>Just implemented your registration Verification Pattern. I&#39;m getting the following error when I register my user: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first.</p><p></p><p>Any idea how I could fit this into your pattern?</p><p></p><p>Regards,</p><p></p><p>Mathieu Bazinet</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/acheo.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by smartymca</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Wed, 16 May 2012 03:05:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015515</guid><description><![CDATA[ <p>Video not working </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/smartymca.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by diago_raj</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Sun, 20 May 2012 03:26:04 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015560</guid><description><![CDATA[ <p>very poor video quality; It gets stuck ed always. Whether I download in any format mp4 or wmv it doesn&#39;t play properly.Not only this more over about 60% of videos are having similar problems. Same situation occurs when I download from other microsoft videos from channel 9 as well.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/diago_raj.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by kevat</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Mon, 25 Jun 2012 22:36:01 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015848</guid><description><![CDATA[ <p>Great video! You should add a bit about how to check for duplicate emails before the verification email is sent out since it seems to be the most logical thing to do in many cases.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/kevat.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by kevat</title><link>http://asp.net/web-forms/videos/authentication/implement-the-registration-verification-pattern</link><pubDate>Mon, 25 Jun 2012 22:43:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015849</guid><description><![CDATA[ <p>Looks like I spoke too soon: there is a simple property in MembershipProviders which allows a developer to that (RequiresUniqueEmail = &quot;true&quot;).</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/kevat.jpg?forceidenticon=false&amp;dt=635051142600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>