Commerce Server General - Problem creating user and address with MSIB classes in ASP.NET

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > August 2005 > Problem creating user and address with MSIB classes in ASP.NET





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 Problem creating user and address with MSIB classes in ASP.NET
nea@apropos-internett.no

2005-08-10, 2:49 am

Hello

I have a problem creating users and addresses in ASP.NET using the
classes in Microsoft.Solutions.Framework namespace.

I have a web page where a user enters name, address, e-mail address and
so on (registration). I want to create a new UserObject (user profile
in CS) for the user and attach an Address.

The UserObject is created correctly. I then create an Address object
which seems OK. However, I see that the UserId in the Address object is
not the same as the UserId of the newly created UserObject. When the
new user goes to look at his user profile, no address information is
displayed. How can I ensure the UserId in UserObject and Address are
the same?

Have anybody had any experience with this? Answers would be most
welcomed.

Regards
Nils Erik Asmundvaag

Joe Wasson [MSFT]

2005-08-17, 5:57 pm

I believe the problem is cause by creating the address before the new user
you created becomes the "current user". When you create an address using
the Microsoft.Solution.Framework classes it takes the current user from
CommerceContext and uses that UserID as the UserID in the Address profile
object. After you create the new profile you need to make that profile the
current user according to Commerce Server.

-joe

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: nea@apropos-internett.no
Newsgroups: microsoft.public.commerceserver.general
Subject: Problem creating user and address with MSIB classes in ASP.NET
Date: 9 Aug 2005 23:46:53 -0700

Hello

I have a problem creating users and addresses in ASP.NET using the
classes in Microsoft.Solutions.Framework namespace.

I have a web page where a user enters name, address, e-mail address and
so on (registration). I want to create a new UserObject (user profile
in CS) for the user and attach an Address.

The UserObject is created correctly. I then create an Address object
which seems OK. However, I see that the UserId in the Address object is
not the same as the UserId of the newly created UserObject. When the
new user goes to look at his user profile, no address information is
displayed. How can I ensure the UserId in UserObject and Address are
the same?

Have anybody had any experience with this? Answers would be most
welcomed.

Regards
Nils Erik Asmundvaag


Nils Erik Asmundvaag

2005-08-24, 7:51 am

Hello

Thank you for the answer. Do you also know how I change the "current
user"?

Regards
Nils Erik Asmundvaag

Joe Wasson [MSFT]

2005-08-24, 6:05 pm

Use SetProfileTicket or SetAuthTicket on
CommerceContext.Current.AuthenticationInfo. You may need to set
CommerceContext.Current.UserProfile to null if you (or something you're
using) have already used the UserProfile property.

Alternatively you can set the UserProfile property yourself with the
profile you just created.

-joe

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Nils Erik Asmundvaag" <nea@apropos-internett.no>
Subject: Re: Problem creating user and address with MSIB classes in ASP.NET
Date: 24 Aug 2005 04:14:20 -0700

Hello

Thank you for the answer. Do you also know how I change the "current
user"?

Regards
Nils Erik Asmundvaag


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com