Repeater and Eval

Gabriel <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.web
Message-ID <[email protected]>
Hello,


I have the code below. I'd like to add a "if" to display only the hyperlink
(the first) only when Url is not empty.

How can I do that ?

Regards,






        <asp:Repeater runat="server" ID="menu"
DataSourceID="SiteMapDataSource1" EnableViewState="False">
                        <ItemTemplate>
                            <li>

                                <asp:HyperLink runat="server"
NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink>

                                <asp:Repeater runat="server" DataSource='<%#
((SiteMapNode) Container.DataItem).ChildNodes %>'>
                                    <HeaderTemplate>
                                        <ul>
                                    </HeaderTemplate>

                                    <ItemTemplate>
                                        <li>
                                            <asp:HyperLink runat="server"
NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink>
                                        </li>
                                    </ItemTemplate>

                                    <FooterTemplate>
                                        </ul>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </li>
                        </ItemTemplate>
                    </asp:Repeater>

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.