locked
Create Menu String RRS feed

  • Question

  • User-956384462 posted

     Hi, I want to create a menu string to build the HTML (of the code below) string in the Page_Load event and write it out to a
    Literal. I'm new to vb.net. Can someone give me a few pointers. Thanks.

     <ul id="nav">   
                    <li class="firstlevel" style="width:60px;">
                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/rent.aspx">Rent</asp:HyperLink>
                    </li>
                     <li class="firstlevel">
                        <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/learn.aspx">Learn</asp:HyperLink>
                        <ul>
                            <li><a href="http://forums.asp.net/AddPost.aspx?ForumID=36#">Climbing perchesi><a href="http://forums.asp.net/AddPost.aspx?ForumID=36#">Labyrinthfishes</a></li>
                            <li><a href="http://forums.asp.net/AddPost.aspx?ForumID=36#">Kissing gouramis</a></li>
                            <li><a href="http://forums.asp.net/AddPost.aspx?ForumID=36#">Pike-heads</a></li>
                            <li><a href="http://forums.asp.net/AddPost.aspx?ForumID=36#">Giant gouramis</a></li>
                        </ul>
                    </li>
                    <!-- etc. -->
                </ul>

    Monday, July 7, 2008 2:19 PM

Answers

  • User-956384462 posted

     you can use a stringbuilder to build up the html and put the data in.

     You can use 2 repeaters.

     Thanks

    Andy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 12, 2008 1:31 PM

All replies

  • User-125547262 posted

     I would strongly recommend using the built in asp.net menu control and databinding it with an xml sitemap file to create a menu.

    Any reason why you would not want to do that?

    Monday, July 7, 2008 2:23 PM
  • User-956384462 posted

     yes. why not?

    I've looked into the asp menu control. I can't use it for this project for certain reasons. 

    Can you help me with my original question.

     

    Thanks

    Andy

    Monday, July 7, 2008 2:46 PM
  • User-956384462 posted

     you can use a stringbuilder to build up the html and put the data in.

     You can use 2 repeaters.

     Thanks

    Andy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 12, 2008 1:31 PM