I have this data from the database with self-relation
Parent_ID name Child_ID 1 cities Tap 2 Egypt 1 3 Saudi 1 4 Technology Null 5 vb.net 4 6 c # 4
Now I want to create an HTML navigation bar using this data
Be similar to the following
& lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; City & lt; / A & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Egypt & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Saudi & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Technology & lt; / A & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Vb.net & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; C # & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt;
I do not know what my biggest way is to use my XML node or my linux ... please help me, which is the best way.
You can use the asp: reipeater
control to the data source and It can give html formatting inside it. The easiest and efficient way
Explore it more ....
EDIT: Mention of you
In MVC You can use code >> and on html ,
ViewData for whatever you like and you can use the couch walking and generate the necessary HTML inside < P> Like
View date ["data" whatever <"] = your data
@ Foreach (in var item ....) {& lt; A href = 'item which value' & gt; }
No comments:
Post a Comment