為了解決匿名用戶登錄成功以後,執行一些操作。在petshop有實現

1.在web.config中 加入 <anonymousIdentification enabled="true" />

表示激發Profile_MigrateAnonymous事件

2.在Global.asax中定義事件

      void Profile_MigrateAnonymous(Object sender, ProfileMigrateEventArgs e) { // 获取匿名用户资料
            
        }

其中: e.AnonymousID為匿名用戶登錄的id

 var currentUser = HttpContext.Current.User;為登錄的用戶名

相关文章:

  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2021-09-06
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
猜你喜欢
  • 2022-02-02
  • 2022-01-02
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-06-18
相关资源
相似解决方案