public ActionResult PostScopeConfig(ScopeConfigModel m)
    {
      if (string.IsNullOrEmpty(m.SelectedScope))
        ModelState.AddModelError("selectedScope", "You must select a scope for widget to target the data in.");

      if (ModelState.IsValid)
      {
        var appSvc = AppServiceRepository.GetService();
        var include = appSvc.GetInclude<ScopeInclude>(m.IncludePath);
        include.ScopeName = m.SelectedScope;
        AppServiceRepository.UpdateService(appSvc);
        return Json(new { success = true, includePath = m.IncludePath });
      }

      return PartialView("WidgetScopeConfig", m);
    }
 public ActionResult ScopeConfig(ScopeConfigModel m)
 {
   var include = AppService.GetInclude<ScopeInclude>(m.IncludePath);
   m.SelectedScope = include.ScopeName;
   return PartialView("WidgetScopeConfig", m);
 }