public ActionResult EditCustomer(string key) { var partyRepo = new PartyRepository(); Customer customer = partyRepo.GetCustomerById(key.ToLong(0)); ViewBag.Input = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(customer))); ViewBag.Id = key.ToLong(0); ViewBag.Title = "Bearbeiten Kunden"; ViewBag.TypeName = "Customer"; if (Request.IsAjaxRequest()) { ViewBag.IsPopup = true; return(PartialView("Customer")); } else { ViewBag.IsPopup = false; return(View("Customer")); } }