Created
December 4, 2014 12:30
-
-
Save woodss/53aad4a669b8071fc3d2 to your computer and use it in GitHub Desktop.
Global ViewData[] Across Controllers in C# MVC
This file contains 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 abstract class GlobalController : Controller { | |
public GlobalController() { | |
ViewData["AvailableEverywhere"] = "This information is available throughout the application!"; | |
} | |
} | |
/* USAGE */ | |
public class HomeController : GlobalController { | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment