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
RSS feed - FeedList for WordPress
Hi,
I'm trying to alter the FeedList plugin for WordPress so that I can click on the title of
filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h
Big Problem!! Please help
Hi Guys,
Im making a website for a friend have encountered a really annoying problem. When ev
Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc
gather checkbox data from form into email
Hello all,
First, i'd like to thank everyone who responded to my previous posts regarding set
login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php
Checking BOM Authorization Group
Hai Friends,
I have developed a mulitilevel BOM display report. End users have been assig
php mysql script to find record
Hi,
Currently I have a simple table with 4 columns. A, B, C, D
If I want to find all
Does deleting the spmlog directory critical?
Hi Everyone,
Please, hope you could help me. We're having problems with the SAP backup. I
how to transport the Query and insfoset
Hi
I have created the query using SQ01........
How to created T-code for query..