using template page menu links design for mvc pages

53 views Asked by At

I have downloaded a template for my app. I have to replace the menu links of this template with my project url links.

Code block of the menu link in template page::

<a href="#" class="list-group-item d-inline-block collapsed" data-parent="#sidebar">
    <i class="fa fa-film"></i> <span class="d-none d-md-inline">
        Item 2 
    </span>
</a>

I have to use this with::

@Html.ActionLink("Program", "Index", "karyakramModels") 

I tried with the code ::

<a href="#" class="list-group-item d-inline-block collapsed" data-parent="#sidebar">
    <i class="fa fa-film"></i> <span class="d-none d-md-inline">
        @Html.ActionLink("Program", "Index", "karyakramModels")
    </span>
</a>

I am not getting the CSS design with this code. Thank You!!!

1

There are 1 answers

0
Vivek Bani On

As you have icon () inside the anchor tag, I would suggest @Url.Action() to use

<a href="@Url.Action('actionName', 'controllerName')" class="list-group-item d-inline-block collapsed" data-parent="#sidebar">
    <i class="fa fa-film"></i> <span class="d-none d-md-inline">
        Program 
    </span>
</a>