I apologize that I’m still extremely new to MVC so please bear with me.
I’m trying to create a dynamic list element for navigation in the _Layout.cshtml.
I’m not really too sure where to go from here. Or where to put my database code. Thanks.
<ul id="navlist">
@foreach (???)
{<li class="navitem"><a href="@nav.Href">@nav.Name</a></li>}
</ul>
Go through a tutorial which builds an application from start to finish using mvc. It will be much better than asking this type of question. Plus you will learn a lot more. But in helping out here is what you do
MVC Controller – Home Controller
Razor View
You can see here all of the basic parts in MVC. We have a Controller which builds a Model and passes it to a View. M V C. The 3 is for the version lol 🙂
Again this is super basic. I would suggest http://www.asp.net/mvc, tekpub.com, for getting a better foundation