Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7654657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:18:49+00:00 2026-05-31T12:18:49+00:00

I am trying to create a menu using <ui><li></li></ui> tags. I am reading from

  • 0

I am trying to create a menu using <ui><li></li></ui> tags. I am reading from an XML file and storing it in a List of(menu) object.

Menu Object:

Public Class MenuVM

#Region "Properties"
    Public Property ID As Integer
    Public Property Description As String
    Public Property Comments As String
    Public Property UserControlName As String
    Public Property AssemblyName As String
    Public Property ModelName As String
    Public Property SortOrder As Integer
    Public Property IsSelected As Boolean
#End Region

End Class

HomeController Class:

    Public Class HomeController
    Inherits System.Web.Mvc.Controller


    Function Index() As ActionResult
        Dim oMenuHelper As New MenuHelper
        Return View("index", oMenuHelper.BuildMenu())
    End Function

    <HttpPost()> _
    Function Index(ByVal iSelect As Integer) As ActionResult
        Dim oMenuHelper As New MenuHelper
        Return View("index", oMenuHelper.BuildMenu())
    End Function

    Function About() As ActionResult
        Return View()
    End Function
End Class

ASPX PAGE:

<%@ Page Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of List(OF MVCApp.MenuVM))" %>
<%@ Import Namespace ="MVCApp" %>
<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">

    <div id="menu" class="block"> 
    <% Using Html.BeginForm("Index", "Home")%>  
      <ul id="menuItems"> 

        <% For Each item As MVCApp.MenuVM In Model%>
         <li><%: Html.ActionLink(item.Description, "Index", "Home", New With {item.ID}, Nothing)%></li>               
        <%Next%>
       </ul> 
        <% End Using %>              

</div> 
</asp:Content>

The output:

enter image description here

When You click on view source the output is as follow:

<!DOCTYPE html>
<html>
<head><title>

    Home Page

</title><link href="Content/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
</head>
<body>
    <div class="page">
        <div id="header">
            <div id="title">
                <h1>My MVC Application</h1>
            </div>
            <div id="logindisplay">


        [ <a href="/Account/LogOn">Log On</a> ]

            </div> 
            <div id="menucontainer">
                <ul id="menu">
                    <li><a href="/">Home</a></li>
                    <li><a href="/Home/About">About</a></li>
                </ul>
            </div>
        </div>
        <div id="main">


    <div id="menu" class="block"> 
    <form action="/" method="post">  
      <ul id="menuItems"> 


         <li><a href="/Home/Index/1">Ballot Language</a></li>               

         <li><a href="/Home/Index/2">Assisting Absentee Voter</a></li>               

         <li><a href="/Home/Index/3">Instructions</a></li>               

         <li><a href="/Home/Index/4">Ballot Questions</a></li>               

       </ul> 
        </form>              

</div> 

            <div id="footer">
            </div>
        </div>
    </div>
</body>
</html>

ERROR: When I Click on the link I am getting following error:

enter image description here

Could any one help with it. My intension is to pass menu id to controller and load appropriate usercontrol. I cannot use Javascript or jquery in this project as user might have javascript disabled on machine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:18:50+00:00Added an answer on May 31, 2026 at 12:18 pm

    You should remove “controller” word from the links. The url should be:”/Home/Index/1″.
    To do so, modify the ActionLink code:

    Html.ActionLink(item.Description, "Index", "Home", New With {item.ID}, Nothing)%>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a dynamic menu by reading an XML file using
I am trying to create a menu using anchor tags, and they should butt
im using jQuery and im trying to create a menu using a list of
I'm trying to create some Menu Item with Image & Label, using barry's class
I am trying to create a menu that slides up from the bottom. It
I am trying to create a simple menu using li elements, but it only
I am trying to create to a vertical navigation menu using CSS sprites. I
I am trying to create options menu in my Android program. I am using
I am trying to create a hierarchical xml based menu in MVC.NET <?xml version=1.0
I've been trying to create a dropdown menu using straight CSS. When you hover

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.