Solved

RememberMe cookie retrieval in MembershipProvider

Posted on 2007-11-20
5
346 Views
Last Modified: 2008-03-03
In asp.net I am using the Login control with the checkbox for the RememberMe (provided by default).

I have created my own custom MembershipProvider.

When I step through the code, upon submission of the Log in control, it steps me through the ValidateUser function. I do not find anywhere in using my debug "watch" window where the RememberMe field is populated.

How do I retrieve the value of the "RememberMe" field so that I can know if a member has selected for me to remember them in a login cookie?

thanks.
0
Comment
Question by:Starr Duskk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:RedKelvin
ID: 20324085
Hi,

You need to set a cookie, and retrieve the value, this shows you how

http://www.codeproject.com/useritems/Remember_me_next_time.asp

RedK
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 20324165
How do I convert that first line to VB? My loginID is:

                <asp:Login ID="Login1" runat="server"         OnLoggedIn="Login1_LoggedIN"
...

But when I set this up in my codebehind, the "Login1" is squiggly underlined...

    Protected Sub Login1_LoggedIN(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim rememberme As CheckBox = Login1.FindControl("RememberMe")


My codebehind inherits:
Inherits System.Web.UI.Page

Is there anything else I need to get the "Login1" to not be squiggly underlined?

thanks!
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 20324320
I think I have it figured out...

Dim rememberme As CheckBox = FindControl("RememberMe")
0
 
LVL 22

Accepted Solution

by:
RedKelvin earned 500 total points
ID: 20324482
very close
Dim rememberme As CheckBox = ctype(FindControl("RememberMe"), CheckBox)
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 20324550
yay! Because what I had definitely wasn't working! :)
thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question