页面属性传值

[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
public class UserControlRenderingPropertyAttribute : Attribute
{
    string _key;

    public string Key
    {
        get { return _key; }
        set { _key = value; }
    }
}

在UC控件中传直

    private string _CheckID = string.Empty;
    [UserControlRenderingProperty(Key = "OpType")]
    public string CheckID
    {
        get
        {
            return this._CheckID;
        }
        set
        {
            this._CheckID = value;
        }
    }

posted @ 2010-11-06 10:42  张宏宇  阅读(313)  评论(0编辑  收藏  举报