Trying to migrate an anonymous profile to an authenticated one
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
RE: Trying to migrate an anonymous profile to an authenticated one
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/de fault.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" <GeoffreyD [at] newsgroup.nospam>
>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
>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
>
>
>
RE: Trying to migrate an anonymous profile to an authenticated one
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: stcheng [at] online.microsoft.com (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
>
>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/d efault.aspx#noti
f
>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.asp x.
>
>==================================================
>
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
>
>--------------------
>>From: "GeoffreyD" <GeoffreyD [at] newsgroup.nospam>
>>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
>>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
>>
>>
>>
>
>