title: Can we save KeyValuePair<K,V> in user profile?
body: <pre><code>[Serializable]
  public class KeyValue : ProfileBase
  {
      public KeyValue() { }
  
      public KeyValuePair&lt;string, string&gt; KV
      {
          get { return (KeyValuePair&lt;string, string&gt;)base["KV"]; }
          set { base["KV"] = value; }
      }            
  }
  
  public void SaveProfileData()
  {
      KeyValue profile = (KeyValue) HttpContext.Current.Profile;
      profile.Name.Add(File);
      profile.KV = new KeyValuePair&lt;string, string&gt;("key", "val"); 
      profile.Save();
  }   
  
  public void LoadProfile()
  {
      KeyValue profile = (KeyValue) HttpContext.Current.Profile;
      string k = profile.KV.Key;
      string v = profile.KV.Value;
      Files = profile.Name;          
  }
  </code></pre>
  
  <p>I am trying to save <code>KeyValuePair&lt;K,V&gt;</code> in asp.net userprofile and it saves also but when i am accessing it, it show both key and value property null, can anybody tells me where i am wrong?</p>
  
  <p>In <code>LoadProfile()</code> k and v are null.</p>
  
  <p><strong>Web.config</strong></p>
  
  <pre><code>&lt;profile enabled="true" inherits="SiteBuilder.Models.KeyValue"&gt;
    &lt;providers&gt;
      &lt;clear/&gt;
      &lt;add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /&gt;
    &lt;/providers&gt;
  &lt;/profile&gt;
  </code></pre>