M
M
Michael2016-08-17 19:32:16
ASP.NET
Michael, 2016-08-17 19:32:16

Navigation, how to make it more convenient to work with you?

Gentlemen, good day to all, I have a stupid question based on vague head doubts ..
Does it make sense to write navigation not with pens, but unload it from the corresponding database tables?
I am developing an application in which there are three areas so far, maybe there will be more. Each realm does its own thing, profile user credentials, and so on.
The bottom line is that all the navigation in the same profile is written by hand, these are about 5 links in the menu, but the application will develop and their number will grow and typeset by hand, as I don’t really want to, and I think it’s not practical.
What I decided to do is to create special tabs in the database.
Roots - for example will store the names of the areas, Nodes - will already store the urls associated with the names and all the necessary information about the urls.
What say gentlemen experts?
A couple of pluses in the direction of this approach:
1 reduction in layout.
2 you can write your own control either under Razor as a helper method or in js.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-08-18
@Milk92

I would think about adding MvcSiteMapProvider besides the fact that you can combine descriptions from xml files and generation from any sources (including DB) contains a lot of usefulness (SiteMap, breadcrumb, etc.) all this is cached. building a menu from the database every time the page is returned is a so-so solution. And despite all this, it works simply and out of the box (NuGet).

P
Pavel Tuzov, 2016-08-17
@PavelTuzov

If the navigation is voluminous, in the form of a tree, then it is better to look towards the nested set. And if this is a typical navigation of a small number of values, then you can get by with one table with a parent_id binding to the parent.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question