Wrox Programmer Forums
|
ASP.NET 4.5 General Discussion For ASP.NET 4.5 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4.5 General Discussion 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 July 14th, 2013, 03:07 AM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default Password Recovery Set Question

Hi I have an issue that I just can't seem to find anything online about;

I'm using a drop down list retrieved from a table for my password recovery questions which stores the question ID in the membership table. Therefore the password recovery control displays this ID so I need to be able to lookup and set the question text when someone uses password recovery.

Can this even be done? I've managed to retrieve the question text by handling the PreRender event of the control but PasswordRecovery1.Question is a read only property.

Any help appreciated.
 
Old July 20th, 2013, 02:54 AM
Staceysmith
Guest
 
Posts: n/a
Default

That was the problem i have been facing..hope it is solved soon..
 
Old July 20th, 2013, 04:46 AM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default

As a temporary (I hope) work around, when binding the question drop down I set both the text and value fields to the question text. Not great because on the page the text is loaded in both drop down fields and in the Membership table it stores the full question text for each user - but at least the proper question is displayed.

I'm hoping I will find a way to override the password recovery by looking it up from the ID in the Question field and setting it to the Question. Haven't found a solution yet though.
 
Old July 30th, 2013, 02:05 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Therefore the password recovery control displays this ID so I need to be able to lookup and set the question text when someone uses password recovery.
Can't you assign the ID to the value and the question to the text of the drop down list?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 31st, 2013, 06:12 AM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I have found that the question control on the registration screen uses the value field (I'm guessing because it's natively a text box) so when assigning the ID/text to value/text of the drop down respectively it saves the ID so I used the following work around so it stores the question text instead:

CreateUserWizard1.Question = question.SelectedItem.Text.ToString();

Problem is I'd much rather store the ID and then lookup the text from the table for the password recovery to display it.

I have managed to handle the PreRender on the recovery control but PasswordRecovery1.Question is a read only property. It seems crazy that you need to store the question text each time and can't opt for an ID, any one with a drop down list would just store repeating text in their database.
 
Old August 3rd, 2013, 07:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
It seems crazy that you need to store the question text each time and can't opt for an ID, any one with a drop down list would just store repeating text in their database.
The control is over 8 years old, so I guess back then they felt it was enough to have only a single question.

You may get away with sub classing the control and providing your own logic.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 8th, 2013, 07:49 AM
Registered User
 
Join Date: Aug 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its totally depends on your logic and requirements of project so that we will be able to implement on same.





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with password recovery control ghadeer_ BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 February 23rd, 2010 04:33 PM
password recovery message kevin33 Wrox Book Feedback 5 November 14th, 2008 05:44 PM
recovery password Jophie BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 10th, 2008 05:39 PM
Profiles and Password Recovery Control Sheraz Khan BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 October 8th, 2007 03:46 PM





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