实现Profile购物车的匿名用户迁移
来源:互联网 发布:c 和java区别 编辑:程序博客网 时间:2024/06/05 16:56
在Global.asax文件中,增加一个方法:
protected void Profile_MigrateAnonymous(Object s, ProfileMigrateEventArgs e)
{
ProfileCommon anonProfile = Profile.GetProfile(e.AnonymousID);
//迁移Profile用户名
//Profile.userName = anonProfile.userName;
//迁移购物车
//Profile.ShoppingCart = anonProfile.ShoppingCart;
IEnumerator ie = anonProfile.ShoppingCart.CartItems.GetEnumerator();
while (ie.MoveNext())
{
Profile.ShoppingCart.AddCartItem((CartItem)ie.Current);
}
//清除匿名COOKIE,不然每次请求页面都执行此事件
AnonymousIdentificationModule.ClearAnonymousIdentifier();
// Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1);
//匿名COOKIE标识已重置,下次匿名访问将创建新的profile数据条,原来的匿名profile数据条已无意义
ProfileManager.DeleteProfile(e.AnonymousID);
}
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zhangzgl/archive/2009/05/12/4170952.aspx
- 实现Profile购物车的匿名用户迁移
- 实现Profile购物车的匿名用户迁移
- 实现Profile购物车的匿名用户迁移
- ASP.net 2.0 学习使用用户配置文件Profile对象(三)如何合并匿名用户配置文件Profile对象解决购物车的问题
- 利用Profile做支持匿名用户到登录用户转移购物车
- profile实现购物车
- 实现匿名用户向注册用户迁移
- Profile实现购物车(应用Profile)(2)
- Profile 详解之匿名用户 Profile 使用
- Asp.Net 2.0的匿名用户的Profile
- Profile实现的Asp.Net购物车持久化实战视频
- 为注册用户实现复杂的数据类型配置--购物车
- Profile 详解之匿名用户初探
- Profile 详解之匿名状态迁移至登录状态
- WebApplication与Profile购物车
- Profile购物车代码片段
- WebApplication与Profile购物车
- 购物车的实现
- 项目经理开门七件事
- mvc保存图片和doc文件
- javascript中replace()
- 在VS6.0工程中创建系统状态栏图标显示?
- Hibernate学习笔记:HQL
- 实现Profile购物车的匿名用户迁移
- C#实现DES加密解密,AES加密解密
- Copy文件的方法
- msn for window server
- c# 正则
- WINAPI
- ext checkboxgroup 回填数据解决
- linux目录架构
- 支持 PS/2 与 USB 的键盘过滤驱动(可卸载)