private GroupBE GetGroupFromUrl() { GroupBE g; string groupid = DreamContext.Current.GetParam("groupid"); //Double decoding of name is done to work around a mod_proxy issue that strips out slashes groupid = XUri.Decode(groupid); if (groupid.StartsWith("=")) { string name = groupid.Substring(1); g = GroupBL.GetGroupByName(name); if (g == null) { throw new GroupNotFoundException(name); } } else { uint groupIdInt; if (!uint.TryParse(groupid, out groupIdInt)) { throw new GroupIdInvalidArgumentException(); } g = GroupBL.GetGroupById(groupIdInt); if (g == null) { throw new GroupIdNotFoundException(groupIdInt); } } return(g); }