Anthem.net fix for GetAnthemManagerKey

Change GetAnthemManagerKey in Manager.cs to the following to fix the problem with the page handler changing during ajax callback.

 

Old Code:

private static string GetAnthemManagerKey() {
Page page = HttpContext.Current.Handler as Page;
if (page == null) {
return "Anthem.Manager.Handler";
}
else {
return "Anthem.Manager." + page.ToString();
}
}

New Code:

private static string GetAnthemManagerKey() {
if (_managerKey.Length > 0) {
return _managerKey;
}
else {
foreach (object item in HttpContext.Current.Items) {
if (item is Anthem.Manager)
_managerKey = item.ToString();
}
}
if (_managerKey.Length == 0) {
Page page = HttpContext.Current.Handler as Page;
if (page == null) {
_managerKey = "Anthem.Manager.Handler";
}
else {
_managerKey = "Anthem.Manager." + page.ToString();
}
}
return _managerKey;
}