悬赏分:5 浏览:188 次
petshop4 重写了 profile
public sealed class PetShopProfileProvider : ProfileProvider
{//实现
}
然后在web.config 这样
<profile automaticSaveEnabled="false" defaultProvider="ShoppingCartProvider">
<providers>
<add name="ShoppingCartProvider" connectionStringName="SQLProfileConnString" type="PetShop.Profile.PetShopProfileProvider" applicationName=".NET Pet Shop 4.0"/>
<add name="WishListProvider" connectionStringName="SQLProfileConnString" type="PetShop.Profile.PetShopProfileProvider" applicationName=".NET Pet Shop 4.0"/>
<add name="AccountInfoProvider" connectionStringName="SQLProfileConnString" type="PetShop.Profile.PetShopProfileProvider" applicationName=".NET Pet Shop 4.0"/>
</providers>
<properties>
<add name="ShoppingCart" type="PetShop.BLL.Cart" allowAnonymous="true" provider="ShoppingCartProvider"/>
<add name="WishList" type="PetShop.BLL.Cart" allowAnonymous="true" provider="WishListProvider"/>
<add name="AccountInfo" type="PetShop.Model.AddressInfo" allowAnonymous="false" provider="AccountInfoProvider"/>
</properties>
</profile>
PetShop.BLL.Cart
PetShop.Model.AddressInfo
在调用的时候这样
请问 Profile.WishList.CartItems
Profile.WishList.Remove(e.CommandArgument.ToString());
break;
case "Move":
Profile.WishList.Remove(e.CommandArgument.ToString());
Profile.ShoppingCart.Add(e.CommandArgument.ToString());
break;
}
Profile.Save();
请问 Profile.WishList.Remove 这些调用的是PetShop.BLL.Cart 的方法 还是调用的
public sealed class PetShopProfileProvider : ProfileProvider
{//实现
} 这个地方定义的方法 谢谢 我困惑啊
|
参考这篇文章,楼主可以先学学.net 的profile新特性.
PetShop 4.0 详解之七(PetShop表示层设计)
http://www.cnblogs.com/YoungPeng/archive/2008/04/30/1177629.html
Hope it help!! |