advertisement

Forum => Article discussions => Load user data once with an HttpModule

Jump to:

Next Oldest | Next Newest

7/8/2007 1:27:23 PM Link | Reply | Edit | Quote

uber:ASP.Net

Location: | Joined: 1/1/2000 | Posts: 12 | Online

Article discussion for:
Load user data once with an HttpModule

7/18/2007 2:47:25 PM Link | Reply | Edit | Quote

Travis

Profile Send Private Message Send E-Mail
Location: | Joined: 7/18/2007 | Posts: 1 | Offline

I am not clear how I would call this, say in on page load and assign the value to the text of a label - can you provide a brief example?

7/18/2007 6:31:58 PM Link | Reply | Edit | Quote

DavidKiff

Profile Send Private Message Send E-Mail
Location: | Joined: 7/18/2007 | Posts: 1 | Offline

Hi, I like the article, however authenticated request is called everytime any part of the page is loaded (ie for a graphic). This has an abvious overhead that is not associated with, lets say, saving user data within a session. May be you could shed some light on this? Please feel free to email me:

nospam (at) davidkiff.co.uk

O travis, you call the method on your static class, in this case:

UserContext.Current.Username

(should a public username property be exposed on the MembershipUser object)

7/19/2007 1:21:50 PM Link | Reply | Edit | Quote

Jeff

Profile Send Private Message Send E-Mail Web Site AOL Instant Message Yahoo Instant Message ICQ Message
Location: Cleveland, OH, USA | Joined: 8/15/2000 | Posts: 813 | Offline

In the local dev server, yes, it is called on graphic requests, but typically in IIS on a production server you're not having ASP.NET handle graphics requests.

This example, by the way, is good when you know every page request will need user data, or you have some kind of integration between systems that use different backing stores for identifying users.

Alternatively, you could do lazy initialization of the user, checking for null on the first call to a static method, and then populating the user data there.


Jeff 'Jones' Putz
POP World Media, LLC
Maximizing ASP.NET

Forum => Article discussions => Load user data once with an HttpModule

Please login or register to post.