diff --git a/Site5/Global.asax b/Site5/Global.asax index 1bfbbb3e..ff940bfe 100644 --- a/Site5/Global.asax +++ b/Site5/Global.asax @@ -72,20 +72,6 @@ // This part really should have been in Application_Start, but it doesn't fire for some reason - // Read build number, or set to "Private" if none - - try - { - using (StreamReader reader = File.OpenText(HttpContext.Current.Request.MapPath("~/BuildIdentity.txt"))) - { - HttpContext.Current.Application["BuildIdentity"] = "Build " + reader.ReadLine(); - } - } - catch (Exception) - { - HttpContext.Current.Application["BuildIdentity"] = "Private Build"; - } - } private void Session_End (object sender, EventArgs e) diff --git a/Site5/Master-v5.master.cs b/Site5/Master-v5.master.cs index a4a9c787..d1519586 100644 --- a/Site5/Master-v5.master.cs +++ b/Site5/Master-v5.master.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Threading; using System.Web; using System.Web.UI; @@ -21,6 +22,23 @@ namespace Activizr this.LanguageSelector.LanguageChanged += new EventHandler(LanguageSelector_LanguageChanged); + // Read build number if not loaded, or set to "Private" if none + + if (HttpContext.Current.Application["BuildIdentity"] == null) + { + try + { + using (StreamReader reader = File.OpenText(HttpContext.Current.Request.MapPath("~/BuildIdentity.txt"))) + { + HttpContext.Current.Application["BuildIdentity"] = "Build " + reader.ReadLine(); + } + } + catch (Exception) + { + HttpContext.Current.Application["BuildIdentity"] = "Private Build"; + } + } + // Titles etc this.IconPage.ImageUrl = "/Images/PageIcons/" + this.CurrentPageIcon + "-40px.png";