Created
May 18, 2014 04:56
-
-
Save loonison123/7be83c5a3f76f9c7d03a to your computer and use it in GitHub Desktop.
New way of loading a menu from json file in MVC BaseController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BaseController : System.Web.Mvc.Controller | |
| { | |
| public BaseController() | |
| { | |
| Initialize(); | |
| } | |
| protected void Initialize() | |
| { | |
| // ... | |
| // GetMenu(); | |
| } | |
| protected override void OnActionExecuted(ActionExecutedContext filterContext) | |
| { | |
| base.OnActionExecuted(filterContext); | |
| this.GetMenu(); | |
| } | |
| private void GetMenu() | |
| { | |
| // Do something with query string and render differently... | |
| // Request.QueryString is not null!!! | |
| NavGenertor navGenerator = new NavGenerator(); | |
| App.Menu = navGenerator.GetTopNav(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment