public ActionResult Display(int ID) { ScreenViewer.API.Elements.TextHTMLController TC = new API.Elements.TextHTMLController(); var actionResult = TC.GetScriptTextHTML(Convert.ToDecimal(ID)); var tresponse = actionResult as OkNegotiatedContentResult <Data.ScriptTextHTML>; //Assert.IsNotNull(response); Data.ScriptTextHTML theText = tresponse.Content; var TextHTML = SPutilities.ReplaceObjectsandQuestions(HttpContext.Session, theText.TextHTMLContent, true); ViewBag.TextTitle = theText.TextHTMLDesc; ViewBag.Content = TextHTML; ViewBag.TextID = theText.ScriptTextHTMLID; bool whatif; try { whatif = (bool)theText.ShowDescTooltip; } catch { whatif = false; } if (whatif) { return(PartialView("_TextHTMLpop")); } else { return(PartialView("_TextHTML")); } }
public string Render(int ID, ControllerContext ContCont) { ScreenViewer.API.Elements.TextHTMLController TC = new API.Elements.TextHTMLController(); var actionResult = TC.GetScriptTextHTML(Convert.ToDecimal(ID)); var tresponse = actionResult as OkNegotiatedContentResult <Data.ScriptTextHTML>; //Assert.IsNotNull(response); Data.ScriptTextHTML theText = tresponse.Content; var TextHTML = SPutilities.ReplaceObjectsandQuestions(ContCont.HttpContext.Session, theText.TextHTMLContent, true); var TextHTML2 = SPutilities.ReplaceObjectsandQuestions(ContCont.HttpContext.Session, theText.TextHTMLAltContent, true); ViewBag.TextID = theText.ScriptTextHTMLID; ViewBag.TextTitle = theText.TextHTMLDesc; if (!string.IsNullOrEmpty(SessionControl.SessionManager.ReturnParameter(ContCont.HttpContext.Session, "SwitchLanguage"))) { ViewBag.Content = !string.IsNullOrEmpty(TextHTML2) ? TextHTML2 : TextHTML; } else { ViewBag.Content = TextHTML; } bool whatif; try { whatif = (bool)theText.ShowDescTooltip; } catch { whatif = false; } if (whatif) { return(RenderHelper.RenderViewToString(ContCont, "~/Views/TextHTML/_TextHTMLpop.cshtml", theText, ViewData)); } else { return(RenderHelper.RenderViewToString(ContCont, "~/Views/TextHTML/_TextHTML.cshtml", theText, ViewData)); } }