Commerce Server Solution Sites - Content Selection

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server Solution Sites > February 2004 > Content Selection





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 Content Selection
newsgroup user

2004-02-19, 12:34 am

Hi,
I am using Commerce Server 2002 and I development
on "Retail2002".
I have created a targeting
expression referencing culture property, and I am using
this expression
in a target group, and this target group in an ad campaign.

How do I make the
"Commerce.ContentSelector" object
aware of this value before I invoke its GetContent method?

Can someone please, give me an actual code sample in
classic ASP .Net demonstrating how to do this.
I have been through the newsgroups with a fine tooth comb,
and I have
yet to find a concrete example.

Thanks in advance!

--

Marcelo

Following is an example of the code I am using to retrieve
the
content:

Public Function DameAnunciosBannerIzquierda() As String
Dim ctx As CommerceContext =
CommerceContext.Current
Dim userProfile As Profile = Nothing
Dim isLoggedOn As Boolean =
ctx.AuthenticationInfo.IsAuthenticated

If isLoggedOn = True Then
Dim profContext As ProfileContext =
ctx.ProfileSystem
Dim userId As String =
ctx.AuthenticationInfo.AuthTicket.UserID

userProfile = profContext.GetProfile
(userId, "UserObject")
End If

Dim csoDiscount As ContentSelector =
ctx.TargetingSystem.SelectionContexts
("Advertising").GetSelector()

csoDiscount.TraceMode = True
csoDiscount.ItemsRequested = 1

If Not IsNothing(userProfile) Then
csoDiscount.Profiles.Add("User", userProfile)
End If
csoDiscount.Size = "BannerIzq"
csoDiscount("border") = 0

Dim discountPayLoad As StringCollection =
csoDiscount.GetContent
Dim s As String
Dim sreturn As String
For Each s In discountPayLoad
sreturn = sreturn & s & "<br>"
Next
Return sreturn
End Function

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com