Bulleted List

Discussion in 'ASP .Net' started by shapper, Mar 30, 2007.

  1. shapper

    shapper Guest

    Hello,

    I have a DataSet with 3 columns:

    Id, Name, Number

    I want to display a list (maybe a bulleted list?) which display a list
    item where each one is an anchor.

    The text of each anchor is created as follows:

    Name (Number)

    The url to which the user is sent when clicking a link is:

    MyPage.Aspx?SectionId=Id

    I have the following:

    If Not Page.IsPostBack Then
    bl.DataSource = MyDataSet
    bl.DataBind()
    End If

    My problem is how to create each item as an anchor with the text and
    address as I described.

    Thanks,

    Miguel
     
    shapper, Mar 30, 2007
    #1
    1. Advertising

  2. shapper

    David Wier Guest

    You can use a DataList, using an ItemTemplate, forming the link exactly the
    way you want
    Something like:
    <ItemTemplate>
    <A HREF='MyPage.Aspx?SectionId=<%# Container.DataItem("id") %>'><%#
    Container.DataItem("Name") %></a>
    </ItemTemplate>


    --
    David Wier
    MVP/ASPInsider
    http://aspnet101.com
    http://aspexpress.com

    "shapper" <> wrote in message
    news:...
    > Hello,
    >
    > I have a DataSet with 3 columns:
    >
    > Id, Name, Number
    >
    > I want to display a list (maybe a bulleted list?) which display a list
    > item where each one is an anchor.
    >
    > The text of each anchor is created as follows:
    >
    > Name (Number)
    >
    > The url to which the user is sent when clicking a link is:
    >
    > MyPage.Aspx?SectionId=Id
    >
    > I have the following:
    >
    > If Not Page.IsPostBack Then
    > bl.DataSource = MyDataSet
    > bl.DataBind()
    > End If
    >
    > My problem is how to create each item as an anchor with the text and
    > address as I described.
    >
    > Thanks,
    >
    > Miguel
    >
     
    David Wier, Mar 30, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Woody Splawn

    How do Bulleted list?

    Woody Splawn, May 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    495
    Scott Mitchell [MVP]
    May 19, 2004
  2. nina297

    Bulleted List question

    nina297, Mar 22, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    416
    Alexey Smirnov
    Mar 22, 2007
  3. wilf
    Replies:
    1
    Views:
    1,655
    Forum
    Sep 21, 2007
  4. toxee
    Replies:
    4
    Views:
    867
    toxee
    Apr 23, 2009
  5. Dave Harrington

    A bulleted list in an ASP.NET Texbox

    Dave Harrington, Apr 5, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    213
    Steve C. Orr [MVP, MCSD]
    Apr 5, 2005
Loading...

Share This Page