Trouble accessing .NET 2.0 Membership stuff from HTTP Module

G

Guest

I am trying to create an HTTP module to run on ASP.NET 2.0. The module needs
to check to see if the user is authenticated with the .net 2.0 membership
stuff. I am trying this:

If application.Context.User.Identity.IsAuthenticated Then
app.Context.Response.Write("user authenticated")
End If

I get a "Object Reference not set to an instance of anobject." error on
application.Context.User.Identity.IsAuthenticated.

I am always getting an error. Does anyone have any suggestions? Do I need
to configure anything special for the module? Thanks.
 
B

Brock Allen

You should look into handling the PostAuthenticateRequest event instead.
That way you don't have ordering issues with the other modules during the
AuthenticateRequest event.
 
G

Guest

Thanks. That fixed it.

Brock Allen said:
You should look into handling the PostAuthenticateRequest event instead.
That way you don't have ordering issues with the other modules during the
AuthenticateRequest event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top