<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX Control Toolkit</title><link>http://forums.asp.net/1022.aspx</link><description>Here's your place to discuss everything in and about the AJAX Control Toolkit</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Ajax TabContainer:  Finding Controls</title><link>http://forums.asp.net/thread/3275826.aspx</link><pubDate>Mon, 06 Jul 2009 03:25:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3275826</guid><dc:creator>PeteNet</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3275826.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3275826</wfw:commentRss><description>&lt;p&gt;its not as if you can&amp;#39;t change the function signature to accept only one parameter and return a List&amp;lt;Control&amp;gt;...that would work in your case..in fact I would pass in the type that I want to find, as the second parameter...and then inside the function I would check for that type and add them to the List to be returned...something like:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;Control&amp;gt; controls = new List&amp;lt;Control&amp;gt;();&lt;/p&gt;&lt;pre&gt;    if (c.GetType().ToString().Equals(&amp;quot;System.Web.UI.WebControls.TextBox&amp;quot;)&lt;br /&gt;          &amp;amp;&amp;amp; c.ID == null)&lt;br /&gt;    {&lt;br /&gt;      // &lt;i&gt;...do something...&lt;/i&gt;&lt;br /&gt;      controls.Add(c);  &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</description></item><item><title>Re: Ajax TabContainer:  Finding Controls</title><link>http://forums.asp.net/thread/3275791.aspx</link><pubDate>Mon, 06 Jul 2009 02:45:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3275791</guid><dc:creator>drpcken</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3275791.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3275791</wfw:commentRss><description>&lt;p&gt;Right, but if I&amp;#39;m looking at this right the function requires a parameter with a string datatype, which is the ID of the control to be returned.&amp;nbsp; In my case I don&amp;#39;t know the ID, just the type.&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;span style="color:blue;font-family:&amp;#39;Courier New&amp;#39;;"&gt;public&lt;/span&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;"&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; Control FindControlRecursive(Control Root, &lt;b&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; Id&lt;/b&gt;)&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Ajax TabContainer:  Finding Controls</title><link>http://forums.asp.net/thread/3275784.aspx</link><pubDate>Mon, 06 Jul 2009 02:41:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3275784</guid><dc:creator>PeteNet</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3275784.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3275784</wfw:commentRss><description>&lt;p&gt;what would you mean?!!?? are you refering to the links I sent you? &lt;/p&gt;
&lt;p&gt;the functions return a Control type, you can access all properties and methods from that Control object, for example:&lt;/p&gt;
&lt;p&gt;FindControlRecursive return FoundCtl....so you should get FoundCtl.ID and FoundCtl.ClientID etc&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Ajax TabContainer:  Finding Controls</title><link>http://forums.asp.net/thread/3275765.aspx</link><pubDate>Mon, 06 Jul 2009 02:09:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3275765</guid><dc:creator>drpcken</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3275765.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3275765</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve used this in the past very well, my problem is I won&amp;#39;t know the control&amp;#39;s ID, just the type.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Ajax TabContainer:  Finding Controls</title><link>http://forums.asp.net/thread/3274380.aspx</link><pubDate>Sat, 04 Jul 2009 07:18:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274380</guid><dc:creator>PeteNet</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274380.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3274380</wfw:commentRss><description>&lt;p&gt;yes, you&amp;#39;d rather use recursion, passing in the control you&amp;#39;re looking for. in fact, it is pretty common to have such a helper in the base class so that it can be used anywhere on the pages etc.&lt;/p&gt;&lt;p&gt;here are a few links: &lt;a href="http://www.west-wind.com/Weblog/posts/5127.aspx"&gt;http://www.west-wind.com/Weblog/posts/5127.aspx&lt;/a&gt; (follow through with the comments too)&lt;/p&gt;&lt;p&gt;and here&amp;#39;s another one: &lt;a href="http://stevesmithblog.com/blog/recursive-findcontrol/"&gt;http://stevesmithblog.com/blog/recursive-findcontrol/&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Ajax TabContainer:  Finding Controls</title><link>http://forums.asp.net/thread/3274146.aspx</link><pubDate>Sat, 04 Jul 2009 02:00:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274146</guid><dc:creator>drpcken</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274146.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3274146</wfw:commentRss><description>&lt;p&gt;I have a TabContainer with some TabPanels.&amp;nbsp; I wrote this loop through it and find specific controls:&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="c-sharp"&gt;foreach (TabPanel t in ContactTabContainer.Tabs)
        {
            if (t.ID == &amp;quot;DentalPanel&amp;quot;)
            {
                foreach (object ctrl in t.Controls)
                {
                    if (ctrl is Control)
                    {
                        Control c = (Control)ctrl;
                        foreach (object innerCtrl in c.Controls)
                        {
                            if (innerCtrl is TextBox)
                            {
                                TextBox txt = (TextBox)innerCtrl;

                                //code


                            }
                        }
                    }
                }
            }
        }&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; Is there a more efficient way of doing this?&amp;nbsp; This seems so cumbersome to me.&amp;nbsp; I could be wrong and it may be exactly right, but I need someone elses opinion.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Thanks!&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>