Commerce Server General - TargetingContextProfile

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > November 2004 > TargetingContextProfile





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author TargetingContextProfile
Brian

2004-10-16, 5:52 pm

Hi,
I'm trying to use TargetingSystem.TargetingContextProfile as Session, but I
can't retrive the value from other pages. My question is how to use
TargetingContextProfile
as Session? Can I do that ?
Thanks for the help!

Set value.
CommerceContext csContext = CommerceContext.Current;
csContext.TargetingSystem.TargetingContextProfile["Key"].Value = lid;

Get value
CommerceContext csContext = CommerceContext.Current;
value = csContext.TargetingSystem.TargetingContextProfile["Key"].Value;



David Messner [MSFT]

2004-11-18, 5:49 pm

TargetingContext is a non-peristent profile - you get a new one on every
page by design (a new Guid is created for each page request where you
access this profile through the TargetingSystem property).

You can create your own non-persistent profile definition for this purpose
(and don't map it to any storage) or use TargetingContext profile through
the profile APIs and not through the
TargetingSystem.TargetingContextProfile property, which is where you get a
new one created with a new Guid on every page request.

Note that this DOES NOT WORK in a load-balanced Web farm scenario; a
non-peristent profile only exists within the profile object cache which is
local to the process (in-memory). You're probably much better off using
ASP.NET session state, cookies, or another mechanism (such as DBStorage
persistence or your own DB persistence).

regards
-djm
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2004 Microsoft Corporation. All rights
reserved.

--------------------
Thread-Topic: TargetingContextProfile
thread-index: AcSzy1jAQfNipw6lQ86WeMe9kcLivw==
X-WBNR-Posting-Host: 141.157.250.249
From: "=?Utf-8?B?QnJpYW4=?=" <Brian@discussions.microsoft.com>
Subject: TargetingContextProfile
Date: Sat, 16 Oct 2004 14:59:02 -0700
Lines: 17
Message-ID: <9DFB41F1-7D4B-47C4-89E9-EE6AADD51BBD@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.general
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.general:14995
X-Tomcat-NG: microsoft.public.commerceserver.general

Hi,
I'm trying to use TargetingSystem.TargetingContextProfile as Session, but I
can't retrive the value from other pages. My question is how to use
TargetingContextProfile
as Session? Can I do that ?
Thanks for the help!

Set value.
CommerceContext csContext = CommerceContext.Current;
csContext.TargetingSystem.TargetingContextProfile["Key"].Value = lid;

Get value
CommerceContext csContext = CommerceContext.Current;
value = csContext.TargetingSystem.TargetingContextProfile["Key"].Value;




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com