473,511 Members | 13,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble accessing .NET 2.0 Membership stuff from HTTP Module

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.
Nov 19 '05 #1
2 1208
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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.


Nov 19 '05 #2
Thanks. That fixed it.

"Brock Allen" wrote:
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
810
by: lanem | last post by:
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...
6
1451
by: matt | last post by:
hello, im working on my first public-facing ASP.NET 2 website, and i have a question/concern about authentication integration. in ASP.NET 1.1, one would typically go w/ a "role yer own"...
5
1217
by: Ryan | last post by:
I have a SQLDataSource I want to tie to the currently logged in user. Is there any way to use User.Identity().Name as a Parameter in the datasource? The only way I've got this to work is by...
4
4718
by: =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post by:
I have been having some trouble with implementing a custom Membership Provider. We have a custom data store and business logic that pulls user information. I need some level of functionality...
3
1603
by: daokfella | last post by:
I'm just starting to dive into the new membership stuff and wondering if it is possible to customize the default membership architecture in ASP.Net 2.0 to do the following: Instead of UserName...
13
5291
by: Kirk | last post by:
I have been reading Scott Allen's article on Master Pages (http:// odetocode.com/Articles/450.aspx) but I am having problems understanding a concept. Specifically, I have created a property...
1
938
by: Cirene | last post by:
I am creating an ASP.NET 2.0 website. Rather than using all the membership functions I wanted to just create my own SQL Server db and use SESSION vars to track if the user is logged in etc... ...
3
1118
by: Andy B | last post by:
I have 2 web applications that need membership added to them. 1 is an admin module for the admin to control the website and the other one is contracts module where customers/clients can login and...
1
1232
by: Jeff | last post by:
Hey ASP.NET 2.0 At work my boss have given me the task of developing a new website. Users will be able to register at the website and gain exclusive access to some information etc... Some...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.