悬赏园豆:5
[已关闭问题]
<P>petshop4 重写了 profile </P>
<P> public sealed class PetShopProfileProvider : ProfileProvider </P>
<P>{//实现</P>
<P>}</P>
<P>然后在web.config 这样</P>
<P><profile automaticSaveEnabled="false" defaultProvider="ShoppingCartProvider"><BR> <providers><BR> <add name="<FONT color=#ff0000>ShoppingCartProvider</FONT>" connectionStringName="SQLProfileConnString" type="<FONT color=#ff0000>PetShop.Profile.PetShopProfileProvider</FONT>" applicationName=".NET Pet Shop 4.0"/><BR> <add name="<FONT color=#ff0000>WishListProvider</FONT>" connectionStringName="SQLProfileConnString" type="<FONT color=#ff0000>PetShop.Profile.PetShopProfileProvider</FONT>" applicationName=".NET Pet Shop 4.0"/><BR> <add name="<FONT color=#ff0000>AccountInfoProvider</FONT>" connectionStringName="SQLProfileConnString" type="<FONT color=#ff0000>PetShop.Profile.PetShopProfileProvider</FONT>" applicationName=".NET Pet Shop 4.0"/><BR> </providers><BR> <properties><BR> <add name="<FONT color=#ff0000>ShoppingCart</FONT>" <FONT color=#3366ff>type="PetShop.BLL.Cart"</FONT> allowAnonymous="true" provider="ShoppingCartProvider"/><BR> <add name="<FONT color=#ff0000>WishList</FONT>" type="<FONT color=#3366ff>PetShop.BLL.Cart</FONT>" allowAnonymous="true" provider="WishListProvider"/><BR> <add name="<FONT color=#ff0000>AccountInfo"</FONT> <FONT color=#3366ff>type="PetShop.Model.AddressInfo</FONT>" allowAnonymous="false" provider="<FONT color=#ff0000>AccountInfoProvider</FONT>"/><BR> </properties><BR> </profile></P>
<P><FONT color=#ff00ff>PetShop.BLL.Cart</FONT></P>
<P><FONT color=#ff00ff>PetShop.Model.AddressInfo</FONT></P>
<P><FONT color=#ff00ff>在调用的时候这样</FONT></P>
<P mce_keep="true">请问 Profile.WishList.CartItems</P>
<P mce_keep="true"><BR> Profile.WishList.Remove(e.CommandArgument.ToString());<BR> break;<BR> case "Move":<BR> Profile.WishList.Remove(e.CommandArgument.ToString());<BR> Profile.ShoppingCart.Add(e.CommandArgument.ToString());<BR> break;<BR> }<BR> Profile.Save();</P>
<P mce_keep="true">请问 Profile.WishList.Remove 这些调用的是<FONT color=#ff00ff>PetShop.BLL.Cart 的方法 还是调用的</FONT></P>
<P mce_keep="true">public sealed class PetShopProfileProvider : ProfileProvider </P>
<P>{//实现</P>
<P>} 这个地方定义的方法 谢谢 我困惑啊</P>
问题补充:
public sealed class PetShopProfileProvider : ProfileProvider
{//实现
}
这个类起得作用是什么 我感觉没什么用处!!!
我知道重写基类 但是没感觉到用在了哪里!!