ChannelCollection Repeater.Databind
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > ChannelCollection Repeater.Databind




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    ChannelCollection Repeater.Databind  
Lta


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-05 10:52 PM

Hi,

I am trying to databind a ChannelCollection to a repeater control but I
think I am expecting it to be far to easy.

Channel collection:

public static ChannelCollection GetSubChannels(Channel c)
{
ChannelCollection cc = null;
if (c != null)
{
cc = c.Channels;
}
return cc;
}

Repeater Html:

<asp:repeater id="SectionMenu" runat="server">
<HeaderTemplate>
head HTML
</HeaderTemplate>
<ItemTemplate>
<Li>
<%# DataBinder.Eval(Container.DataItem, "DisplayName") %>
</Li>
</ItemTemplate>
<FooterTemplate>
foot HTML
</FooterTemplate>
</asp:repeater>


DataBind:

Guid g = GetRootNavGuid(thisUrl);
Channel c = Functions.Channels.GetChannelByGuid(g);
ChannelCollection sc = Functions.Channels.GetSubChannels(c);
sectionMenu.DataSource = sc;
sectionMenu.DataBind();

Any suggestions?

Thanks





[ Post a follow-up to this message ]



    RE: ChannelCollection Repeater.Databind  
Mei Ying [MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-05 07:48 AM

Hi

The code looks good :-)
There could be a tiny typo with "sectionMenu". It's defined to have a
capital "S" in the HTML.

--
regards
Mei Ying
---
Blog: http://meiyinglim.blogspot.com
Book: http://www.packtpub.com/book/mcms
Contact: meiyinglim@hotmail.com
---


"Lta" wrote:

> Hi,
>
> I am trying to databind a ChannelCollection to a repeater control but I
> think I am expecting it to be far to easy.
>
> Channel collection:
>
> 		public static ChannelCollection GetSubChannels(Channel c)
> 		{
> 			ChannelCollection cc = null;
> 			if (c != null)
> 			{
> 				cc = c.Channels;
> 			}
> 			return cc;
>  		}
>
> Repeater Html:
>
> <asp:repeater id="SectionMenu" runat="server">
> 	<HeaderTemplate>
> 		head HTML
> 	</HeaderTemplate>
> 	<ItemTemplate>
> 		<Li>
> 		<%# DataBinder.Eval(Container.DataItem, "DisplayName") %>
> 		</Li>
> 	</ItemTemplate>
> 	<FooterTemplate>
> 		foot HTML
> 	</FooterTemplate>
> </asp:repeater>
>
>
> DataBind:
>
> 	Guid g = GetRootNavGuid(thisUrl);
> 	Channel c = Functions.Channels.GetChannelByGuid(g);
> 	ChannelCollection sc = Functions.Channels.GetSubChannels(c);
> 	sectionMenu.DataSource = sc;
> 	sectionMenu.DataBind();
>
> Any suggestions?
>
> Thanks





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:58 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register