Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <div class="display-field">
  2. @Html.DisplayFor(model => model.ContentBody)
  3. </div>
  4.  
  5. <div class="display-field">
  6. @Html.Raw(Model.ContentBody)
  7. </div>
  8.  
  9. string name = "<p><span style="font-size: small; color: #ff0000;"><span style="font-size: small;">&nbsp;<span style="font-size: large; color: #000000;">Hi</span><br />&nbsp; <br />This is just a sample,<br />This will not work with @Html.Raw(),<br />";
  10. <span>@Html.Raw(name);</span>
  11.  
  12. @MvcHtmlString.Create(HttpUtility.HtmlDecode(@model.ContentBody))
  13.  
  14. @Html.Raw(HttpUtility.HtmlDecode(@model.ContentBody));
  15.  
  16. public ActionResult Index(int id)
  17. {
  18. var content = _contentRepository.GetContent(id);
  19. var classViewModel = new ClassViewModel
  20. {
  21. ContentBody = WebUtility.HtmlDecode(ClassViewModel.ContentBody)
  22. };
  23. return View(classViewModel);
  24. }
  25.  
  26. @MvcHtmlString.Create(@Model.OurVision)
  27.  
  28. <div class="display-field">
  29. @model.ContentBody
  30. </div>
  31.  
  32. MvcHtmlString myHtmlString = MvcHtmlString.Create("htmlcodeandtext");
  33.  
  34. ....
  35. Description = WebUtility.HtmlDecode(narration.Narration1)
  36.  
  37. <div>
  38. @Html.TextAreaFor(model => model.Description, HtmlAttributeHelper.ConditionalDisable(false, new {@class = "tinymce"}))
  39. </div>
  40.  
  41. ......
  42. <td class="col-word-wrap">@Html.Raw(HttpUtility.HtmlDecode(@item.Narration1))</td>
  43.  
  44. string noHTML = Regex.Replace(inputHTML, @"<[^>]+>|&nbsp;", "").Trim();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement