Displaying blog categories in partial view on layout page

yahooooooooo

New Member
Currently I have a partial view where I manually display all my blog categories with links. I would like to make it dynamic by pulling from the database. I am not sure how to accomplish this within a partial view. I would even be willing to do it within the actual _layout page if it's easier that way.Here is what I have right now._Categories.cshtml\[code\]<h2>Categories</h2><hr/><p> <a href="http://stackoverflow.com/questions/15602257/@Url.Action("Category", "Blog", new {id = 1})">ASP.Net MVC</a><br/> <a href="http://stackoverflow.com/questions/15602257/@Url.Action("Category", "Blog", new {id = 2})">Ruby on Rails</a><br/></p>\[/code\]I would like to create these links dynamically as opposed to hard coding._Layout.cshtml\[code\]@Html.Partial("_Categories")\[/code\]The main problem is there is no controller for the layout of a partial which is why I can't figure out how to go about it.Thanks in advance for any help.
 
Back
Top