Contents tagged with HTML

  • Customizing Body Summary in Orchard

    ASP.NET, MVC, Razor, FontAwesome, Orchard, HTML

    In Orchard, the content summaries are displayed with a limit of 200 characters and a default "more" link after the body summary.  I felt the summary length was much too short, and I wanted to customize how the "more" link was displayed using an icon in the link.  Surprisingly the first part was quite easy, it was the latter part that took a bit more effort to tweak.

    I found the file where the summaries were being created, it exists in the Orchard.Core/Common/Views/Parts.Common.Body. …

    Read more 

  • ASP.NET MVC Accepting HTML Input from View

    ASP.NET, MVC, Razor, HTML, ValidateInput

    By default, ASP.NET will not allow any HTML or JavaScript tags to be entered as text for an input field. It will throw an error stating:

    "A potentially dangerous Request.Form value was detected from the client..."

    This is a built-in security mechanism to prevent Cross-Site Scripting (XSS) or other forms of injection attacks. However for my blog, I needed to be able to accept HTML tags for the blog posts, so I did some research and found two primary ways around this problem.

    [ValidateInput( …

    Read more 

  • 1