ProfileModule.MigrateAnonymous イベント
アセンブリ: System.Web (system.web.dll 内)

Dim instance As ProfileModule Dim handler As ProfileMigrateEventHandler AddHandler instance.MigrateAnonymous, handler
public: event ProfileMigrateEventHandler^ MigrateAnonymous { void add (ProfileMigrateEventHandler^ value); void remove (ProfileMigrateEventHandler^ value); }

ASP.NET アプリケーションの Global.asax ファイルの ProfileModule クラスの MigrateAnonymous イベントには、Profile_MigrateAnonymous グローバル イベントを使用して、このトピックの例に示されている方法によってアクセスできます。
MigrateAnonymous イベントは、アプリケーションを匿名で使用しているユーザーがログインした場合に、プロファイル プロパティ値を匿名プロファイルから認証済みプロファイルにコピーするために使用できます。
ユーザー プロファイルが有効にされたアプリケーションを起動すると、ASP.NET によって、ProfileBase クラスを継承する ProfileCommon 型の新しいクラスが作成されます。profile 構成セクションに定義されているそれぞれのプロパティに対して、厳密に型指定されたアクセサが ProfileCommon クラスに追加されます。GetProfile メソッドを使用すると、ユーザー名に基づいて ProfileCommon オブジェクトを取得できます。現在の認証済みプロファイルの GetProfile メソッドを使用することで、その匿名プロファイル プロパティ値を取得できます。それにより、匿名プロファイル プロパティ値を、認証済みユーザーの現在のプロファイルにコピーできます。

匿名ユーザーをサポートする匿名の識別およびプロファイル プロパティを有効にする Web.config ファイルの例を次に示します。
<configuration> <system.web> <authentication mode="Forms" > <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" /> </authentication> <anonymousIdentification enabled="true" /> <profile enabled="true" defaultProvider="AspNetSqlProvider"> <properties> <add name="ZipCode" allowAnonymous="true" /> <add name="CityAndState" allowAnonymous="true" /> <add name="StockSymbols" type="System.Collections.ArrayList" allowAnonymous="true" /> </properties> </profile> </system.web> </configuration>
ASP.NET アプリケーションの Global.asax ファイルに含まれる MigrateAnonymous イベントを次のコード例に示します。MigrateAnonymous イベントは、匿名プロファイルから現在のユーザーのプロファイルへと、プロファイル プロパティ値をコピーします。
Public Sub Profile_OnMigrateAnonymous(sender As Object, args As ProfileMigrateEventArgs) Dim anonymousProfile As ProfileCommon = Profile.GetProfile(args.AnonymousID) Profile.ZipCode = anonymousProfile.ZipCode Profile.CityAndState = anonymousProfile.CityAndState Profile.StockSymbols = anonymousProfile.StockSymbols '''''''' ' Delete the anonymous profile. If the anonymous ID is not ' needed in the rest of the site, remove the anonymous cookie. ProfileManager.DeleteProfile(args.AnonymousID) AnonymousIdentificationModule.ClearAnonymousIdentifier() End Sub
public void Profile_OnMigrateAnonymous(object sender, ProfileMigrateEventArgs args) { ProfileCommon anonymousProfile = Profile.GetProfile(args.AnonymousID); Profile.ZipCode = anonymousProfile.ZipCode; Profile.CityAndState = anonymousProfile.CityAndState; Profile.StockSymbols = anonymousProfile.StockSymbols; //////// // Delete the anonymous profile. If the anonymous ID is not // needed in the rest of the site, remove the anonymous cookie. ProfileManager.DeleteProfile(args.AnonymousID); AnonymousIdentificationModule.ClearAnonymousIdentifier(); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からProfileModule.MigrateAnonymous イベントを検索する場合は、下記のリンクをクリックしてください。

- ProfileModule.MigrateAnonymous イベントのページへのリンク