{"id":3693,"date":"2014-03-29T08:04:18","date_gmt":"2014-03-29T08:04:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/unable-to-access-the-dynamic-control-collection-of-common-programming-errors\/"},"modified":"2014-03-29T08:04:18","modified_gmt":"2014-03-29T08:04:18","slug":"unable-to-access-the-dynamic-control-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/unable-to-access-the-dynamic-control-collection-of-common-programming-errors\/","title":{"rendered":"Unable to Access the Dynamic control-Collection of common programming errors"},"content":{"rendered":"<p>A recursive FindControl might be more helpful if you do have the control&#8217;s ID.<\/p>\n<pre><code>public static T FindControlRecursive(this Control parentControl, string id) where T : Control\n    {\n        T ctrl = default(T);\n\n        if ((parentControl is T) &amp;&amp; (parentControl.ID == id))\n            return (T)parentControl;\n\n        foreach (Control c in parentControl.Controls)\n        {\n            ctrl = c.FindControlRecursive(id);\n\n            if (ctrl != null)\n                break;\n        }\n        return ctrl;\n    }\n\/\/ and then: Page.FindControlRecursive(idOfYourControl);\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A recursive FindControl might be more helpful if you do have the control&#8217;s ID. public static T FindControlRecursive(this Control parentControl, string id) where T : Control { T ctrl = default(T); if ((parentControl is T) &amp;&amp; (parentControl.ID == id)) return (T)parentControl; foreach (Control c in parentControl.Controls) { ctrl = c.FindControlRecursive(id); if (ctrl != null) break; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3693","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3693"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3693\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}