TargetingContextProfile
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
TargetingContextProfile

 
Post new topic   Reply to topic    Windows Server Forum Index -> Commerce Server
Author Message
Brian
Guest





Posted: Sun Oct 17, 2004 2:59 am    Post subject: TargetingContextProfile Reply with quote

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;
Back to top
David Messner [MSFT]
Guest





Posted: Fri Nov 19, 2004 3:44 am    Post subject: RE: TargetingContextProfile Reply with quote

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;
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Commerce Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB