Hi
FindControl method is to locate a control with an ID
property of <<Control>> on the containing page.
Check ChannelPanelId after adding the Display Panel.
HTH
Ravikanth
[color=blue]
>-----Original Message-----
>I know I am doing or understanding something wrong. This
>is a code snipet from a server control that accesses the
>MCMS channel structure to build a dynamic cascading menu
>system. While this is not the actual code (too[/color]
extensive)[color=blue]
>it performs the key function and provides the same
>unsatisfacto ry results:
>
>Channel current = CurrentContext. Channel;
>Panel Display = new Panel();
>
>foreach(Channe l subchannel in current.Channel s)
>{
> Panel channelPanel = new Panel();
> channelPanel.ID = subchannel.Name ;
> Display.Control s.Add(channelPa nel)
>}
>
>string chName = current.Channel s[0].Name;
>Panel foundPanel = Display.FindCon trol(chName);
>
>It seems that since there are 3 subchannels to current,
>foundPanel should return the first Panel added in the
>foreach loop. It doesn't. It returns null. Why?
>
>Thanks.
>.
>[/color]
FindControl method is to locate a control with an ID
property of <<Control>> on the containing page.
Check ChannelPanelId after adding the Display Panel.
HTH
Ravikanth
[color=blue]
>-----Original Message-----
>I know I am doing or understanding something wrong. This
>is a code snipet from a server control that accesses the
>MCMS channel structure to build a dynamic cascading menu
>system. While this is not the actual code (too[/color]
extensive)[color=blue]
>it performs the key function and provides the same
>unsatisfacto ry results:
>
>Channel current = CurrentContext. Channel;
>Panel Display = new Panel();
>
>foreach(Channe l subchannel in current.Channel s)
>{
> Panel channelPanel = new Panel();
> channelPanel.ID = subchannel.Name ;
> Display.Control s.Add(channelPa nel)
>}
>
>string chName = current.Channel s[0].Name;
>Panel foundPanel = Display.FindCon trol(chName);
>
>It seems that since there are 3 subchannels to current,
>foundPanel should return the first Panel added in the
>foreach loop. It doesn't. It returns null. Why?
>
>Thanks.
>.
>[/color]
Comment