SelectionContexts("Discounts").GetSelector()
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Content Selection Framework > SelectionContexts("Discounts").GetSelector()




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    SelectionContexts("Discounts").GetSelector()  
Mark Meehan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:48 AM

CommerceContext.Current.TargetingSystem.SelectionContexts(ctxt).GetSelector(
).GetContent().Count
returns 0 unless I put a break point on this line and step over the
call.  It will work correctly if I step through the code. If I run
outside of the debugger or I run from the debugger and put a
breakpoint past this call, it always returns a count of 0. Any help
would be great.



For example:

Dim ctx As CommerceContext = CommerceContext.Current
Dim ctxt As String = selectionContextVal.ToString
Dim cso As ContentSelector

<BREAK POINT>       cso =
CommerceContext.Current.TargetingSystem.SelectionContexts(ctxt).GetSelector(
)
<STEP OVER>
If Not cso Is Nothing Then

CommerceContext.Current.TargetingSystem.TargetingContextProfile("PageGroup")
.Value
= pageGroupVal

Dim userLanguage As String = Nothing

If ctx.AuthenticationInfo.IsAuthenticated() Then
Dim userProfile As Profile = ctx.UserProfile

If Not userProfile Is Nothing Then
cso.Profiles.Add("User", userProfile)
End If
End If

ctx.TargetingSystem.TargetingContextProfile("Culture").Value
= cultureVal

cso.ItemsRequested = 1
cso.Size = sizeVal.ToString

cso.Profiles.Add("targetingContext",
ctx.TargetingSystem.TargetingContextProfile)
cso.TraceMode = traceModeVal

If history <> "" Then
cso.PageHistory = history
End If

Dim Ads As StringCollection = Nothing

Try
Ads = cso.GetContent()
Catch
End Try

history = cso.PageHistory

If (Not Ads Is Nothing) Then
If (Ads.Count > 0) Then
Return Ads
End If
End If

Return Nothing
End If





[ Post a follow-up to this message ]



    RE: SelectionContexts("Discounts").GetSelector()  
David Messner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-30-04 01:03 AM

I notice you are catching and eating all exceptions below.  Are you sure
you're not getting an exception that you are silently ignoring?  You could
set VS.NET to break on all exceptions to check.

I'm not sure we have enough information to go on to help you with this one.
Is there any event in the application event log?

What is the relevance of your <BREAK POINT> tags in the snippet below?  Are
you saying that if you don't break here that the cso object is null or
something?

<BREAK POINT>       cso =
CommerceContext.Current.TargetingSystem.SelectionContexts(ctxt).GetSelector(
)
<STEP OVER>

best
-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.

--------------------
From: mark.meehan@gmail.com (Mark Meehan)
Newsgroups: microsoft.public.commerceserver.campaigns_csf
Subject: SelectionContexts("Discounts").GetSelector()
Date: 17 Sep 2004 08:39:23 -0700
Organization: http://groups.google.com
Lines: 64
Message-ID: <7d046a9a.0409170739.22da8740@posting.google.com>
NNTP-Posting-Host: 199.199.209.149
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1095435567 10883 127.0.0.1 (17 Sep 2004
15:39:27 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 17 Sep 2004 15:39:27 +0000 (UTC)
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP0
8.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad
.net!postnews2.google.com!not-for-mail
Xref: cpmsftngxa06.phx.gbl
microsoft.public.commerceserver.campaigns_csf:2850
X-Tomcat-NG: microsoft.public.commerceserver.campaigns_csf

CommerceContext.Current.TargetingSystem.SelectionContexts(ctxt).GetSelector(
).GetContent().Count
returns 0 unless I put a break point on this line and step over the
call.  It will work correctly if I step through the code. If I run
outside of the debugger or I run from the debugger and put a
breakpoint past this call, it always returns a count of 0. Any help
would be great.



For example:

Dim ctx As CommerceContext = CommerceContext.Current
Dim ctxt As String = selectionContextVal.ToString
Dim cso As ContentSelector

<BREAK POINT>       cso =
CommerceContext.Current.TargetingSystem.SelectionContexts(ctxt).GetSelector(
)
<STEP OVER>
If Not cso Is Nothing Then


CommerceContext.Current.TargetingSystem.TargetingContextProfile("PageGroup")
.Value
= pageGroupVal

Dim userLanguage As String = Nothing

If ctx.AuthenticationInfo.IsAuthenticated() Then
Dim userProfile As Profile = ctx.UserProfile

If Not userProfile Is Nothing Then
cso.Profiles.Add("User", userProfile)
End If
End If

ctx.TargetingSystem.TargetingContextProfile("Culture").Value
= cultureVal

cso.ItemsRequested = 1
cso.Size = sizeVal.ToString

cso.Profiles.Add("targetingContext",
ctx.TargetingSystem.TargetingContextProfile)
cso.TraceMode = traceModeVal

If history <> "" Then
cso.PageHistory = history
End If

Dim Ads As StringCollection = Nothing

Try
Ads = cso.GetContent()
Catch
End Try

history = cso.PageHistory

If (Not Ads Is Nothing) Then
If (Ads.Count > 0) Then
Return Ads
End If
End If

Return Nothing
End If






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:32 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register