Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Link in BulletedList from Code

Reply
Thread Tools

Link in BulletedList from Code

 
 
Jonathan Wood
Guest
Posts: n/a
 
      11-07-2007
I have a master page that contains a BulletedList.

<asp:BulletedList runat="server" id="mainmenu" CssClass="nav">
</asp:BulletedList>

In my page's Load event, I'm populating the bulleted list based on the role
of the current user. Right now, my test code looks like this:

for (int i = 0; i < 8; i++)
{
ListItem item = new ListItem();
item.Text = String.Format("Menu Item {0}", i + 1);
mainmenu.Items.Add(item);
}

The problem is I want to insert an <a> tag so that each list item is a link.

Does anyone know how to dynmically add items to a BulletedList that include
HTML markup?

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

 
Reply With Quote
 
 
 
 
Mansi Shah
Guest
Posts: n/a
 
      11-07-2007

Hi,

You can Add <a> tag to Bulletedlist like,

<a>
<asp:BulletedList runat="server" id="mainmenu" CssClass="nav">
</asp:BulletedList></a>



Regards,
Mansi Shah.

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Sunfire
Guest
Posts: n/a
 
      11-07-2007
Hi... I was wondering the same thing. Except my problem is only a certain
part of list item 7 needs to be a link... how do you do that as well?


"Mansi Shah" <> wrote in message
news:...
>
> Hi,
>
> You can Add <a> tag to Bulletedlist like,
>
> <a>
> <asp:BulletedList runat="server" id="mainmenu" CssClass="nav">
> </asp:BulletedList></a>
>
>
>
> Regards,
> Mansi Shah.
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
Jonathan Wood
Guest
Posts: n/a
 
      11-07-2007
Wouldn't that make the entire list a link? Is there no way to make list
items links?

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Mansi Shah" <> wrote in message
news:...
>
> Hi,
>
> You can Add <a> tag to Bulletedlist like,
>
> <a>
> <asp:BulletedList runat="server" id="mainmenu" CssClass="nav">
> </asp:BulletedList></a>
>
>
>
> Regards,
> Mansi Shah.
>
> *** Sent via Developersdex http://www.developersdex.com ***


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<asp:BulletedList> =?Utf-8?B?SmliZXkgSmFjb2I=?= ASP .Net 5 01-30-2007 05:24 PM
BulletedList Stan SR ASP .Net 3 12-19-2006 10:54 AM
how to stop < and > from being rendered into &lt and &gt in a listitem (bulletedlist) Tony ASP .Net 0 10-20-2006 02:22 AM
BulletedList inside BulletedList Stan SR ASP .Net 2 08-31-2006 05:36 AM
BulletedList - building the url using a field from the datasourcecontrol benliu ASP .Net 0 08-22-2006 06:12 AM



Advertisments