Losing Membership Provider Settings

B

Brett Ossman

I have a simple sample app that offers a ChangePassword.Aspx page. If I
click a link to that page, all my membership provider settings work fine, but
if I Response.Redirect to that same page, seems the app totally loses track
of any of my provider settings, such as my passwordStrengthRegularExpression.


For example:

This loads ChangePassword.Aspx and all membership provider settings work:
<asp:HyperLink ID="HyperLink3" runat="server"
NavigateUrl="~/MemberPages/ChangePassword.aspx">Change
Password</asp:HyperLink>

However, the following loads ChangePassword.Aspx when it should, but it
seems to lose track of my provider settings such as my regular expression.
Any attempt to enter a new password fails:

If Membership.ValidateUser(Login1.UserName.ToString, Login1.Password) Then
' Check for a first-time login
If mu.LastPasswordChangedDate = mu.CreationDate Then
Response.Redirect("~/MemberPages/ChangePassword.Aspx?
Reason=FirstLogin")
Else
FormsAuthentication.RedirectFromLoginPage
(Login1.UserName, Login1.RememberMeSet)
End If
End If

FYI, the RedirectFromLoginPage work fine also.

Any ideas? I can get into more detail if need be, but thought this might be
enough.

Thanks
Brett Ossman
 
B

Brett Ossman

Nevermind, I figured it out. :)
I applied my redirect logic to the LoggedIn event instead and all works well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top