473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
2 5682
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Akseli Mäki | last post by:
Hi, the subject say quite a lot. I have about the following code(4.01 transitional): <p>blaa blaa blaa <ul> <li><a href="foo.html">foo</a></li> <li><a href="bar.html">bar</a></li> </ul>
4
by: abs | last post by:
Anybody has an idea how to get the <ul> element which is not nested in <li> element ? In other words I have several lists like this: <ul id="1"> <li>Aaaaaaaa</li> <li>Bbbbbbbb</li>...
2
by: Olivier Verdin | last post by:
Hi, It seems that it is not possible to use <il> tag inside an asp.net repeater. Is there any way to overcome this difficulty? Thanks, Olivier
11
by: namenotgivenhere | last post by:
My design goal is to make the white space above and below <p> and <ul> equal to the height of my font. The first step to achieving this I believe is to have an equal amount of white space above or...
0
by: jkn | last post by:
Hello all I'm having some problems with a list within a menu div. I'm a fairly naive CSS user and suspect there's a concept or two I'm missing... I have an unordered list of link tests within a...
1
by: jasonchan | last post by:
How do you align <ol> and <ul> elements when they are contained in a floated box? Here is my website: http://geocities.com/jasonchan483/ Here's my problem. The markers of the lists are...
3
by: Man-wai Chang | last post by:
A 2 columns x 10 rows matrix input form <ul> <li> <ul> <li>item name 1 <li><input type="textbox" name="input_col_1_row_1"> <li><input type="textbox" name="input_col_1_row_2"> </ul> <li>
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
2
by: cityman007 | last post by:
Hi Somebody help me to solve the problem with <ul><li> with images. I used images with Hspace and Vspace and beside the images i make list. its overlapping in Firefox and not seen in IE7 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.