Code behind value of a control in an user control
<p>I am getting ImageButtons ID which is a part of my user control. To this imageButton i have a primary key(code) associated with it. I am getting the ID of the image button (" ImgBtn" ). How do I get the Code(primary key) of the image button that is present on the page.</p>

<p>Below is my code that I am executing.</p>

<pre><code>Control ctrl_Usr = (Page.LoadControl("Product_UserControl.ascx"));
Control myControl = FindControlRecursive(ctrl_Usr, "imgBtn");
string id = myControl.ID;
</code></pre>

<p>Function is :</p>

<pre><code>public static Control FindControlRecursive(Control container, string name)
    {
        if ((container.ID != null) &amp;&amp; (container.ID.Equals(name)))
            return container;

        foreach (Control ctrl in container.Controls)
        {
            Control foundCtrl = FindControlRecursive(ctrl, name);
            if (foundCtrl != null)
                return foundCtrl;
        }
        return null;
    }
</code></pre>

<p>Now in string variable id i want the code say (code_101) insted of imgBtn.</p>
