Retrying loading build number -- this time in master page background

This commit is contained in:
Rick Falkvinge
2011-12-10 23:09:52 +00:00
parent dcd8f86c2f
commit a1efa7b8df
2 changed files with 18 additions and 14 deletions
-14
View File
@@ -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)
+18
View File
@@ -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";