Q:

how to set Key-value pair on .CS side?

I have found one kind of solution to use key-value but the problem is that when I use it on .Cs like 
MyUserControl1.Param.Key = "Area";
MyUserControl1.Param.Value = Area 
Its not allowing me to do so...below is the code...
public partial class MyUserControl : System.Web.UI.UserControl
{
    private Dictionary<string, string> labels = new Dictionary<string, string>();

    public LabelParam Param
    {
        private get { return null; }
        set
        { 
            labels.Add(value.Key, value.Value); 
        }
    }

    public class LabelParam : WebControl
    {
        public string Key { get; set; }
        public string Value { get; set; }

        public LabelParam() { }
        public LabelParam(string key, string value) { Key = key; Value = value; }
    }
}
If I use it aspx page like below it work fine:

<%@ Register src="MyUserControl.ascx" tagname="MyUserControl" tagprefix="test" %>

<test:MyUserControl ID="MyUserControl1" runat="server">
    <Param Key="d1" value="ddd1" />
    <Param Key="d2" value="ddd2" />
    <Param Key="d3" value="ddd3" />
</test:MyUserControl>

A:

When you use your Param property like you mentioned:
MyUserControl1.Param.Key = "Area"
MyUserControl1.Param.Value = Area 

You will get an error because you are accessing the get part of your Param property. The implementation of the get part of the property always returns null, which will cause your code to fail with possible a NullRefrenceException.
Apart from this your control contains several keyvaluepairs in your dictionary, so it does not make sense using the Param property to access the values.
Try adding a property like:
public IDictionary<string,string> Labels
{
    get 
    { 
       return labels; 
    }
}

Then you can access the values like:
myControl.Labels["Key"] = value;

