I want to show the version info of the current project on every page.
The way I do it in the moment is like this:
Inside the Index method of my homecontroller:
ViewBag.Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
Inside the _layout.cshtml(masterpage):
@ViewBag.Version
The Problem here is, it will only displayed once, but I want to display the Version on every page/view.
This is my routing configuration:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
Do I have to change something here ?
Ty for helping