Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 8th, 2004, 12:01 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataList -

DataList
Can you make the contents have a href links?

For example I am using DataList for Menu Item in ascx files to populate it dynamically using DataSet that got the Menu item from database.

I got the code working for DataList without a href links but I want the a href link to be dynamic too.

My code that works:

<asp:datalist id="dlMenu" runat="server">
<ItemTemplate>
<TD align="left" class="SectionMenu" align="left" vAlign="top">
<asp:Label id=lblProductID runat="server" Width="100px" Text='<%# DataBinder.Eval(Container,"DataItem.MenuName") %>' >
</asp:Label>
</TD>
</ItemTemplate>
</asp:datalist></tr>



When I add the a href to the code it doesn't work:

<asp:datalist id="dlMenu" runat="server">
<ItemTemplate>
<TD align="left" class="SectionMenu" align="left" vAlign="top">
<asp:Label id=lblProductID runat="server" Width="100px" Text='<a href="http://www.somesite.com<%# DataBinder.Eval(Container,"DataItem.MenuLink") %>"><%# DataBinder.Eval(Container,"DataItem.MenuName") %>'</a>
</asp:Label>
</TD>
</ItemTemplate>
</asp:datalist></tr>

Right now it only displays the 10 menu item
but I want these menu items to have their corresponding links so I can load up the menu items dynamically.



Remember links:

<a href="http://www.somesite.com/default.aspx">Home</a>

So why doesn't this work?





Similar Threads
Thread Thread Starter Forum Replies Last Post
DataList pbyrum ASP.NET 2.0 Basics 2 December 3rd, 2009 04:01 PM
Datalist inside datalist amit.jagtap ASP.NET 2.0 Professional 1 September 4th, 2007 05:03 AM
Datalist cp75 ASP.NET 1.0 and 1.1 Professional 10 September 8th, 2006 11:38 AM
DataList in DataList acko ASP.NET 1.0 and 1.1 Professional 3 July 9th, 2004 05:18 PM
about datalist bvrao VS.NET 2002/2003 0 December 24th, 2003 06:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.