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
pull content
I have an existing page, domain/adverts.php which has a good PR. I've just rebuilt my site and the n
Putting double spaces instead of single spaces
Im looking at trying to replace all single spacing between fields with double spacing
At pres
generating random codes
Hi guys n gals,
I have a requirement to generate 250,000 unique codes...
These codes a
retrieving images from mysql database using php
So I've been trying to figure out how to store images in a mysql database, and as far as i can tell
Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t
Getting Resource id #11 while trying to connect..
So i tried using "DEFINE" for the first time and im using the variables i defined to conne
can i optmize image to 50% quality before uploading 2 server
Hi there
i have jus written a php program to upload and display images but when i try to uplo
How to replace search button with link?
hi to everbody.
i have a search submit form and button like this :
<form id="f
removing space from the end of a variable
i have a variable $image which contains the following url "http://tiles.xbox.com/tiles/oo/P5/0m
ereg_replace issue
hi there people
i have this code happening with regards to my wamp server. is this something