issues verifying if user is logged in
Posted on
16th Feb 2014 07:03 pm by
admin
I am having issues when a user logs in via asp Login control, the IsAuthenticated still seems to come up false... ( yes the username and password is correct)
Can anyone tell me what I might be missing ?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
setupForm()
If (Page.IsPostBack) Then
'Dim loggedIn As Boolean = HttpContext.Current.Request.IsAuthenticated
End If
If (Not Page.IsPostBack) Then
'Popup dialog won't fire if user is already in.
If (Request.IsAuthenticated) Then
mpeLogin.Enabled = False
pnLogin.Visible = False
logStatus.Visible = True
logName.Visible = True
Else
mpeLogin.Enabled = True
pnLogin.Visible = True
logStatus.Visible = False
logName.Visible = False
End If
End If
End Sub
Private Sub setupForm()
' set the Login control properties
lgLogin.CreateUserText = _JoinNowText
lgLogin.CreateUserUrl = _JoinNowURL
lgLogin.PasswordRecoveryText = _PasswordRecoveryText
lgLogin.PasswordRecoveryUrl = _PasswordRecoveryUrl
lgLogin.InstructionText = _InstructionText
lgLogin.HelpPageText = _HelpPageText
lgLogin.HelpPageUrl = _HelpPageUrl
lgLogin.DestinationPageUrl = _DestinationPageUrl
lgLogin.RememberMeSet = _RememberMeSet
lgLogin.RememberMeText = _RememberMeText
pnLogin.CssClass = _LoginPanelCss
lblBeforeButton.Text = _LoginPanelLabel
pnLogin.Width = _LoginPanelWidth
End Sub
'Continue to display the popup dialog and failure text if login failed.
Protected Sub lgLogin_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles lgLogin.Authenticate
Dim name As String = HttpContext.Current.User.Identity.Name
'Add authentication logic here.
'e.Authenticated = ((lgLogin.UserName = "gbeford") And (lgLogin.Password = "spring!"))
e.Authenticated = HttpContext.Current.Request.IsAuthenticated
Dim test As Boolean = HttpContext.Current.User.Identity.IsAuthenticated
Dim isLoggedIn As Boolean = FormsAuthentication.Authenticate(lgLogin.UserName, lgLogin.Password)
If (Not e.Authenticated) Then
mpeLogin.Show()
End If
End Sub
No comments posted yet
Your Answer:
Login to answer
67
27
Other forums
Any Good MMORPGs you've played?
I'm about to have ALOT of free time on my hands (finished highschool) and I need something to fill t
Email to a friend script problems
I have this send-to-a-friend script with 2 issues:
1) When you open the form popup on a p
BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,
I was able to successfully create an Inbound delivery with reference to a PO
Run function every 5 mins ??
I have a function PostMessage()
How can I run it every 5 mins ??
fopen() security
As i understood the usage of fopen() for it to function correctly the Dir you write to has to be rw
batch file not building to webapps folder
Hello. I just started running Vista :P and can't seem to get my projects deployed. I found out how
Page not Loading After Test
Hey All
It seemed that an inlcude statement wasn't working for some reason, so I tried a more
Product categories for registration
Dear all,
We are going live with the Supplier registered next week. At standard, the 'sel
Array question
Does anyone know how to create a program that takes the $ amount for 8 different departments and gi
ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al