RE: 2005-FormsAuthentication, Httpcontext.current.user is always nothi
- From: ns <ns@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Mar 2008 10:15:01 -0700
I am usingit for Oracle, also the interesting is that i am able to access the
Httpcontext.current.user in the Page, but i the global.asax it is always
nothing.
I have already developed the code in 2003, which is working fine.
Now the new project is developed in 2005, and am copying the same code.
I don't understand why, i can't access it in global.asax, as i need to add
roles.
I understand that on the first request it will be nothing, but it is nothing
even after authentication and on every subsequent request, and at the same
time i am able to
access httpcontext in the other page except in global.asax.
I don't want to go for provider model.
--
n
"ns" wrote:
I am using visual studio 2005, i manually addded global.asax.vb and changed.
global.asax to use the code behind.
When i step into the authenticate request, i get the
HttpContext.current.user as nothing always.
AM i missing anyhting ?, has the implementation of forms authentication
changed in
Visual studio 2005.
What are the things i should look at.
I am always getting HttpContext.current.User as nothing.
Imports Microsoft.VisualBasic
Imports System
Imports System.Web
Imports System.Web.SessionState
Imports System.Security.Principal
Public Class [Global]
Inherits System.Web.HttpApplication
Private Sub Global_AuthenticateRequest(ByVal sender As Object, ByVal e
As System.EventArgs) Handles Me.AuthenticateRequest
Dim UserName As String = ""
Try
UserName = HttpContext.Current.User.Identity.Name.ToString
Catch ex As Exception
End Try
End Sub
End Class
--
n
- Prev by Date: Re: SFTP
- Next by Date: Re: Change class of element in code
- Previous by thread: Re: 2005-FormsAuthentication, Httpcontext.current.user is always nothi
- Next by thread: SFTP
- Index(es):
Relevant Pages
|
|