Personalization with custom user class?

D

Danny Tuppeny

Hi all,

I'm after some advice...

I'm building a website which will have a login etc.. The Personalization in
asp.net 2 stuff looks like it'll save me some time (login controls etc.),
however, the rest of my site ties very intimately into my users. I have many
tables (such as News, PhotoGallery, ForumPost) which have a UserID column.
From a user, I want to be able to get at a List<News>, List<PhotoGallery>
etc.

I was originally planning on writing everything myself (without
personalization), and have a static property on the user class, which
returns an instance of User from the session (or creates a new one, if we
don't have one), so I could do something like:

Response.Write("You have written " + User.Session.NewsArticles.Count + "
news articles");

Where Session returns an instance of User (from the session), and
NewsArticles lazy loads a List<News>.

Now, do I go ahead with all this stuff, or use personalization? I'd like to
use it (it'll save time), but I don't want to send up with two user classes
to store things like my List<NewsArticles>. It looks like Personalization
can store this, but serialised, and I want the data in my NewsArticle table!

I thought my solution to everything, would be inheritance! My ideal would be
to tell asp.net (via web.config) that MyNamespace.User is the
"personalzation" class (which inherits from the asp.net one), and I can
override the Load/Save parts, and add all my extra methods. However, I can't
find such a way of doing things.

Am I missing something easy? :eek:(

Thanks!
 

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,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top