Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 29th, 2009, 07:02 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default Flixon Templates + Caching

hi - i have been using the new flixon templates to generate some code and was wondering...say for example, i have a login screen and a user successfully logs in. i then want to store that user in session...or someplace else? i have been looking at bizobject.cs and it contains a lot of cache code. is there a mechanism in there i could/should be using instead of vanilla session?

thanks for any replies.
 
Old April 29th, 2009, 12:12 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

What exactly do you mean by "store the user in session"?

The Session object is unique to each user. Not sure why you would want a user's session to store the user itself? Normally, the user's logged-in state is persisted via an authentication ticket that is passed back and forth on each request via a cookie.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old April 29th, 2009, 04:20 PM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi lee,
thanks for your reply. it was simply so that i could have access to various user fields during a user's visit. ie i create a user when a user logs in and i want to have access to various fields of that user during their visit to the site. i'm not clear that all these fields are contained within the ticket?
 
Old April 29th, 2009, 04:51 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

The authentication ticket contains no field information whatsoever. It only contains a encrypted key that identifies the user.

Depending on which properties you need at runtime, you can do one of the following:

1. Use the Membership API to get user-related information. You can use the GetUser method to retrieve an object representing the current user:

MembershipUser currentUser = Membership.GetUser();

Then, you can access the properties of currentUser.

2. If you use the ASP.NET Profile system, you can store any additional information you want about the user (personal info, contact info, etc), then use the Profile object to retrieve that information.

Profiles offer a much more reliable alternative to Session state for storing user information. Unlike Session state, profile properties are strongly typed, meaning that their types are known at design time. This lets us access them without casting, do compile-time checking on them, use Intellisense with them, and so on.

3. Finally, you can store personal user information in your own custom tables, and write your own API for accessing the data. That's a lot of work that probably isn't necessary unless you have some special need, like needing to run a lot of custom queries against the data.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}

Last edited by Lee Dumond; April 29th, 2009 at 04:53 PM..
 
Old April 30th, 2009, 03:27 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi lee. i use my own tables for storing user info, since i didn't like the way that the profiles thing serialised everything. anyway, i guess you have clarified the situation for which many thanks.
 
Old July 18th, 2009, 11:03 AM
Registered User
 
Join Date: Dec 2008
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Getting the current user information in the RSS reader

Hi,
I'm want to filter the article list (in the webpart) by the user information.
The code I wrote is getting the current user information using the code below -
Code:
MembershipUser usr = Membership.GetUser();
However, when the code is running in the GetArticlesRSS.aspx.cs, it always returns null.

The same code in the welcome box is returning the right information, but I didn't figured out what is differnet.

Any help will be appriciated.
Dror




Similar Threads
Thread Thread Starter Forum Replies Last Post
Caching stu9820 ASP.NET 3.5 Basics 0 June 20th, 2008 03:20 PM
using Flixon to regenerate the Store crab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 April 21st, 2008 10:15 AM
Flixon Site Generator jimibt BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 February 14th, 2008 11:33 AM
flixon generator against sql server 2000 forumuser BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 11 February 4th, 2008 01:07 PM
Caching bmains ASP.NET 1.x and 2.0 Application Design 4 February 27th, 2004 09:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.