0
가능한 중복을 이름 - 값 쌍을 저장하기 :
나는 asp.net 프로필에 이름 - 값 쌍을 저장할
Store a generic dictionary in an asp.net profile?어떻게 asp.net 프로필에
, 어떻게 나는 이것을한다?
가능한 중복을 이름 - 값 쌍을 저장하기 :
나는 asp.net 프로필에 이름 - 값 쌍을 저장할
Store a generic dictionary in an asp.net profile?어떻게 asp.net 프로필에
, 어떻게 나는 이것을한다?
같은 키 값 데이터를 저장할 수있는 클래스 정의 :
<profile defaultProvider="AspNetSqlProfileProvider">
<properties>
<add name="List"
type="Samples.AspNet.Profile.KeyValue"
serializeAs="Binary" />
</properties>
</profile>
지금이 같은 값을 추가 할 수 있습니다 :
KeyValue data= new KeyValue();
data.dict.Add("Contoso","value");
bookCart.CartItems.Add("Microsoft","value2");
Profile.List= data;
namespace Samples.AspNet.Profile
{
[Serializable]
public class KeyValue{
public Dictionary<string, Object> dict= new Dictionary<string, Object>();
}
}
이 키 값 유형의 설정에서 프로파일을 초기화를
감사합니다, 우리는 "Profile.List = data;"를 어떻게 사용할 수 있는지 설명해 주실 수 있습니까? – gaurav
지금 당장 ProfileBase를 사용하고 있기 때문에 profile = HttpContext.Current.Profile; profile.SetPropertyValue ("Images", sc); – gaurav
당신이 볼 수 있듯이 KeyValue의 List 객체를 할당하기 위해'Samples.AspNet.Profile.KeyValue' 유형의 데이터를 보유하고있는'name = List' 프로파일을 추가했거나'Profile.SetPropertyValue ("List", data) ; –