Link to home
Start Free TrialLog in
Avatar of Starr Duskk
Starr DuskkFlag for United States of America

asked on

RememberMe cookie retrieval in MembershipProvider

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.
Avatar of RedKelvin
RedKelvin

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
Avatar of Starr Duskk

ASKER

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!
I think I have it figured out...

Dim rememberme As CheckBox = FindControl("RememberMe")
ASKER CERTIFIED SOLUTION
Avatar of RedKelvin
RedKelvin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yay! Because what I had definitely wasn't working! :)
thanks!