Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 3rd, 2007, 04:41 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Quote:
quote:Originally posted by ViagraFalls


Maxxim - Thanks. I did find that link afterwards. Will look into it, but that does indeed seem the easiest way to do things. I figure I'll just automatically put Verified to 0, store a GUID + e-mail address in a temporary table and have the extra page set Verified to 1, and flush the row from the temporary table (with either a scheduled job fluhsing all 'expired' entries from the temporary table, or using a SQL job to do that for me every hour (if my hosting provider allows me to)).
peter,

the way i'd work this one would be to have a 'proper' temporary user table which contains:

userid (from membership table)
uniqueguid (NOT the aspnet membership guid, rather set in code at time of membership request)
requestdatetime (getutcdatetime at time of request)

then, when the user clicks on the link (in the email), the temporary guid is looked up, which in turn finds the userid. using the userid, you can then set the IsApproved flag on the table to True and delete the row from the temporary user table. housekeeping could be performed on the database on a weekly basis and any rows in the temporary user table that were older than (say a week) a defined period could be joined with the membership table and rows from both tables removed.

just my scots 2 pence worth!! [:d]

jimi

http://www.originaltalent.com
 
Old September 4th, 2007, 06:07 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi again Jim,

I did mean a "real" table instead of an actual temporary table. Poor choice of words there. I'd probably end up calling it something like "tmp_UsersNotApproved" or something like that.

I also decided I wanted a GUID of my own, as well as include the e-mail address in the URL, to add some extra security. I'v so far just stripped the profile update as part of the registration process (users can always use the "edit profile" link later on if they want), and I guess I have no choice but to also remove the automatic e-mail (through the txt file) that's included in the Wizard as Marco uses it.

The same link about the mail verification also has another link about requiring users to verify their e-mail address AGAIN if they opt to change their address, which I think I will also be adding.

As for the datagrid, on the asp.net forums there's an http://forums.asp.net/t/1012442.aspx extension of the GridView, that allows multi-column sorting, a static header, and some other nice to have functionality (which ought to save up on licenses for Telerik components :D

Cheers,

Peter

http://entropia-online.blogspot.com/
 
Old September 6th, 2007, 03:49 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

I succesfully managed to implement a GUID into an E-mail last night. I was using some local MSDN installation that contained an error, which caused me to bang my head against the desk for two nights straight.

(For those interested, the article I used to base my code on dealt with the SendingMail event. I tried putting breakpoints on it, but never saw it jump in. This lead me to believe something went wrong and the event wasn't triggered (but it was). I finally found a post somewhere referring to the same MSDN article, but this time with correct code. Where the article I printed contained e.Message.Body.Replace, the correct syntax is of course e.Message.Body = e.Message.Body.Replace. Once I figured that out, I tried again, and this time saw that indeed the URL including the GUID had replaced my <%link%> placeholder. The event *still* didn't seem to fire though, as my code never even bothered jumping to debug mode).

I also decided to move the Membership tables from the ASPNETDB to my own database. That all went well, until I tried registering a new user, and ran into an error stating I needed at least 7 characters, including a non-alphanumeric one. I think I found a solution (which is removing the existing MemberShipProvider, before declaring the one Marco uses), but I'll have to wait until tonight before I can test that.

Reason for migrating the database tables is that I bought one SQL database at my webhost, and I want to use single-sign on for the whole eventual website (which will include wiki-like sections and what not).

I think the easiest way to share these things is by just copy/pasting the files used in the solution into a ZIP and uploading that to my google group. That way you can see what I ended up tweaking, and perhaps can use it to your advantage :)).


http://entropia-online.blogspot.com/
 
Old September 24th, 2007, 04:06 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

As an update, this weekend I succesfully finished work on both Email + link verification, adding a Captcha to the registration process.

The Captcha I ended up using is a fullblown control. I did some tweaking to it in order for it to blend into the Register page (like expanding its inputbox's width, and adding dashed borders to it).

As for the E-mailing, I basically stripped the Profile bits out of the CreateUserWizard, added a sendingmail event to the wizard, and had the code for the event generate a GUID. I also ensured the CreateUserWizard would not automatically enable the users (a boolean flag).

The GUID along with the e-mail address are parsed into a link which leads to my activation page. A stored procedure, at the same time (for now I'm just using a localised Sqlcommand in the page, rather than extending the existing DAL class) inserts the GUID, the Email address, and the current system time into a temporary table.

When the user clicks the link, they will be heading to the Activation page, which contains two textboxes; one for the GUID and one for the E-mail address. On the PageLoad event, if the querystring contains the GUID and the E-mail address, the user will automatically be activated. Otherwise, this will happen when the user enters the values into the textboxes. (this is again done with a stored procedure).

When the activation is succesful, the user is then automatically refered to the rules of the site. :)

Hope someone else can use this info :)

Cheers,

Peter

http://entropia-online.blogspot.com/





Similar Threads
Thread Thread Starter Forum Replies Last Post
CAPTCHA Code MunishBhatia ASP.NET 2.0 Basics 2 December 24th, 2007 03:49 AM
Failed to get link in e-mail on signup Ajoy BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 15 August 26th, 2007 02:22 PM
logo link in the header & strange chars - mail luisjeronimo BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 June 26th, 2007 11:07 AM
how to send activation link with e mail spbharti PHP How-To 2 December 28th, 2005 09:17 AM
e-mail a link p2ptolu Classic ASP Databases 1 June 17th, 2005 06:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.