遍历Attributes

   protected void Button4_Click(object sender, EventArgs e)
    {
        AttributeCollection ac = Button2.Attributes;
        IEnumerator key = ac.Keys.GetEnumerator();
        if (key != null)
            while(key.MoveNext())
            {
                Response.Write(string.Format("{0}=\"{1}\"<br>", key.Current, ac[key.Current.ToString()].ToString()));
            }
    }

posted on 2010-04-28 16:21  cqchi  阅读(326)  评论(0编辑  收藏  举报

导航