Reputation: 69
so I am developing a MVC5 project and my situation is this:
I have a view called "Menu Editor" and I want to be able to add new pages from this view. By pages, I mean like, If someone wanted to create a new page called "Help", they write "Help" and press add,then an "Help" option appears in the navbar and you can click it and it redirects you to ".../Help
" which would be created in runtime and just be a default view.
How can I do that and can I do that from view?
For the sake of simplicity lets assume I have a fresh ASP.NET MVC project since all I want to learn is how to do it and what is the correct syntax and It has nothing to do with my paragraphs of unsimplified code.
If that helps; I also have DevExpress plugin/extension installed and implemented.
Upvotes: 2
Views: 540
Reputation: 551
The ideal way of handling this is to have the core stuff handled as normal but adding a sort of database or similar,
In your RouteConfig.cs at the end do a check against this data set and see if any urls are matching the request.
If yes, you can redirect the request to the controller and handle page loading from there.
The content of each page can be stored in files, memory or something of that nature.
Hope this helps.
Upvotes: 0
Reputation: 3218
System should post http request and add <li>
node when post is successfull.
<li>
node.Upvotes: 2