By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,989 Members | 1,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,989 IT Pros & Developers. It's quick & easy.

need help generating a dynamic list control <ul />...

P: n/a
hi there,

i'm creating a dynamic menu system for a CMS website application. What i am
currently doing is the following: in a function called LoadMenu(), i loop
through the required db records and add the menus on the fly, however
because its not known which folder level the page will be on, i need to use
a <asp:hyperlinkcontrol so i can use the navigateUrl="~/...."
functionality, whilst still programaticallly creating the <ul><li></li></ul>
tags.

I tried the following:

1. Using a Literal control - does not allow child controls.
2. Use a placeholder control - i can add the hyperlink but i dont know how
to add the relevant list tags.

If there is a way to add the "<ul>" tag from a server side control, eg. new
HTMLGenericControl, can anyone give me a quick example code?
Any help appreciated.
thanks,
Paul
Jan 25 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,
|
| If there is a way to add the "<ul>" tag from a server side control, eg.
new
| HTMLGenericControl, can anyone give me a quick example code?
|

You could use a Repeater, take a look at MSDN for examples of how to use it,
in essence is very easy you just select the piece of code you want to
repeat, assign a data source and the repeater will do the rest.

--
Ignacio Machin
machin AT laceupsolutions com
Jan 25 '07 #2

P: n/a
hi there,

yeh i thought of this option, but because i'm grouping the menus by a field
called GroupID, on each new group, i need to create a new <ul></ultag and
place the menu items in there.

i think i've almost got it now using the placeHolder and GenericHTMLControl.

thanks,.
Paul
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:eF**************@TK2MSFTNGP03.phx.gbl...
Hi,
|
| If there is a way to add the "<ul>" tag from a server side control, eg.
new
| HTMLGenericControl, can anyone give me a quick example code?
|

You could use a Repeater, take a look at MSDN for examples of how to use
it,
in essence is very easy you just select the piece of code you want to
repeat, assign a data source and the repeater will do the rest.

--
Ignacio Machin
machin AT laceupsolutions com


Jan 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.