Click here to Skip to main content
15,999,626 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am trying to generate dynamic menu list in Partial view. This partial view will be called from Layout Page. Name of Partial View is TopMenu, Name of controller is TopMenu Controller and name of Action Method is TopMenuToLoad.

It works fine and also generated menu from following code in partial view...


@foreach (var item in Model)
       {
           <tr>
               <td>
                   @Html.ActionLink(item.MenuName, item.ControllerPath)
               </td>
           </tr>
       }


but when I click on any of links generated it takes me to following URL :

http://localhost:53071/TopMenu/~/Customer/Index

I want to take it to:


http://localhost:53071/Customer/Index.


link to my folder structure : http://s7.postimg.org/ocqpqvniz/Capture.jpg[^]
Posted
Updated 18-Feb-15 20:28pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900