Trying to migrate an anonymous profile to an authenticated one

G

GeoffreyD

Hi

I'm having trouble with using Profile.GetProfile(e.AnonymousID) from the
profile_MigrateAnonymous event handler. I'm trying to implement this in a
code behind file for Global.asax but Profile.GetProfile() is not defined. I
understand that this could be related to Profile being a class generated at
run time and therefore I cannot use it at compile time? How do I work around
this? Global.asax is not permitted to have a <script> section and a
code-behind file.

Thanks
Geoff
 
S

Steven Cheng[MSFT]

Hi Geoff,

As for the Global.asax in ASP.NET 2.0, you can still provide a codebehind
file for it, the difference is that you use it as a base class instead of
partial class:

http://rossnelson.blogspot.com/2005/11/fixing-globalasax-in-aspnet-20.html

Thus, you can use all the codebehind coding style in it for your global
class.

Also, as for the "Profile" class, yes, it is a page specific property which
is generated at runtime. However, you can use Profile through the following
standard built-in class:

==========
ProfileBase p = ProfileBase.Create("user name here...");
....
============

#ProfileBase.Create Method (String)
http://msdn2.microsoft.com/en-us/library/ms151825.aspx

You need to import the "System.Web.Profile" namespace.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "GeoffreyD" <[email protected]>
Subject: Trying to migrate an anonymous profile to an authenticated one
Date: Thu, 24 Jan 2008 14:55:08 +0200
Hi

I'm having trouble with using Profile.GetProfile(e.AnonymousID) from the
profile_MigrateAnonymous event handler. I'm trying to implement this in a
code behind file for Global.asax but Profile.GetProfile() is not defined.
I
 
S

Steven Cheng[MSFT]

Hi Geoff,

Does my last reply help you some? If there is any further question on this
, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
From: (e-mail address removed) (Steven Cheng[MSFT])
Organization: Microsoft
Date: Fri, 25 Jan 2008 03:50:54 GMT
Subject: RE: Trying to migrate an anonymous profile to an authenticated one
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top