I've been using Coldfusion and the older version ASP -- I am trying to adapt a current site (as I know the content well) to C#/ASP.NET.. When it comes to all the Datagrid controls etc, things seem to work great.. but when I need to make dynamic controls or build menu's etc I am finding tough to sort out the logic to procede.
I can access the DB's and fill Datatsets and dump to datagrid's -- but I'd like to loop through the DB to create an HTML List.
Many have told me to stay away from things like document.write and looping through a DB to output HTML.
If you have a CSS Menu (thats in a <UL>) that is dynamically generated froma a DB call how do you go about it?
Part of me thinks thatere has to be and ASP <UL> replacement or do I make the code in a Label and dump it that way? <% %> code blocks with do while's to geenrate HTM code?
I am at the start if this and I dont want to take a messy first step.
<!-- Sidebar Navigation START -->
<DIV id="navigation1">
<UL>
<LI class="headingTop">Heading Text 1</li>
<LI><A HREF="#">ITEM 1</A></LI>
<LI><A HREF="#">ITEM 2</A></LI>
<LI><A HREF="#">ITEM 3</A></LI>
<LI><A HREF="#">ITEM 4</A></LI>
<LI class="headingTop">Heading Text 2</li>
<LI><A HREF="#">ITEM 1</A></LI>
<LI><A HREF="#">ITEM 2</A></LI>
<LI><A HREF="#">ITEM 3</A></LI>
<LI><A HREF="#">ITEM 4</A></LI>
</UL>
</DIV>
Normally I would just loop throug the DB and do response.write's with the <LI>'s.. What is the C# method that works the best? I dont need anything complicated just a starting point.. A simple loop embedded in an aspx page that would generate a <UL> list.
wbochar
I can access the DB's and fill Datatsets and dump to datagrid's -- but I'd like to loop through the DB to create an HTML List.
Many have told me to stay away from things like document.write and looping through a DB to output HTML.
If you have a CSS Menu (thats in a <UL>) that is dynamically generated froma a DB call how do you go about it?
Part of me thinks thatere has to be and ASP <UL> replacement or do I make the code in a Label and dump it that way? <% %> code blocks with do while's to geenrate HTM code?
I am at the start if this and I dont want to take a messy first step.
<!-- Sidebar Navigation START -->
<DIV id="navigation1">
<UL>
<LI class="headingTop">Heading Text 1</li>
<LI><A HREF="#">ITEM 1</A></LI>
<LI><A HREF="#">ITEM 2</A></LI>
<LI><A HREF="#">ITEM 3</A></LI>
<LI><A HREF="#">ITEM 4</A></LI>
<LI class="headingTop">Heading Text 2</li>
<LI><A HREF="#">ITEM 1</A></LI>
<LI><A HREF="#">ITEM 2</A></LI>
<LI><A HREF="#">ITEM 3</A></LI>
<LI><A HREF="#">ITEM 4</A></LI>
</UL>
</DIV>
Normally I would just loop throug the DB and do response.write's with the <LI>'s.. What is the C# method that works the best? I dont need anything complicated just a starting point.. A simple loop embedded in an aspx page that would generate a <UL> list.
wbochar