I have this from ASP.NET 4.0 which works great, using Visual WEB developer Express.
However in Vis Studio 2012 Pro, get error on yellow line
Object reference not set to an instance of an object.
I want to get the user name and also send them to a area/page which is used for authenticate user.
I have looked for several days to figure this out and have gotten nothing.
However in Vis Studio 2012 Pro, get error on yellow line
Object reference not set to an instance of an object.
I want to get the user name and also send them to a area/page which is used for authenticate user.
I have looked for several days to figure this out and have gotten nothing.
Code:
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
BundleConfig.RegisterBundles(BundleTable.Bundles)
AuthConfig.RegisterOpenAuth()
[highlight #FCE94F]If User.Identity.Name <> "" Then[/highlight]
Session("UserName") = User.Identity.Name
Else
Session("UserName") = "DEMO"
End If
End Sub
[code]
DougP