protected void ValidateTabAndModuleContext(HttpContextBase context, int portalId, out int tabId) { tabId = context.FindTabId(); if (tabId != Null.NullInteger) { if (!TabIsInPortal(tabId, portalId)) { //todo localize error message throw new HttpException(400, "Specified tab is not in this portal"); } int moduleId = context.FindModuleId(); if (moduleId != Null.NullInteger) { var module = TestableModuleController.Instance.GetModule(moduleId, tabId); if (module != null) { ActiveModule = module; } else { //todo localize error message throw new HttpException(400, "Specified tab module does not exist"); } } } }