public ActionResult MosaicText(string encrypted) { encrypted = Helpers.XOR.Decrypt(encrypted, Helpers.Constants.XORAppKey); string scriptURL = HttpUtility.UrlDecode(encrypted); CardMosaicTextModel model = new CardMosaicTextModel(); try { using (var client = new WebClient()) { string json = @client.DownloadString(scriptURL); JObject cardInfo = JObject.Parse(json); string cardType = cardInfo["type"].ToString(); if (cardType.ToLower() == "mosaictext") { model = cardInfo["parameters"].ToObject<CardMosaicTextModel>(); return PartialView(model); } else { return RedirectToAction("Error"); } } } catch { return RedirectToAction("Error"); } }
public ActionResult MosaicText(CardMosaicTextModel model) { model.Title = HttpUtility.HtmlDecode(model.Title); model.Description = HttpUtility.HtmlDecode(model.Description); if (model.ImageURL.Count == 0) { model.ImageURL.Add(Url.Content("~/Content/images/defaultimage.png")); model.ImageURL.Add(Url.Content("~/Content/images/defaultimage.png")); model.ImageURL.Add(Url.Content("~/Content/images/defaultimage.png")); } model.LeftFooter = HttpUtility.HtmlDecode(model.LeftFooter); model.RightFooter = HttpUtility.HtmlDecode(model.RightFooter); return PartialView(model); }