Save HTML tag in Grid/Inline editing content

3 posts, 1 answers
  1. Hyewon
    Hyewon avatar
    2 posts
    Member since:
    Aug 2019

    Posted 07 Nov 2019 Link to this post

    I'm making the Grid/Inline editing list using Kendo UI MVC referring this: 

    I was trying to create and update text with HTML tag, for example, <br>, <h> with some other texts.

    But whenever I put HTML tags such as those and even like '<b', '<h', it wasn't created or updated.

    They're not updated and created like this image below:

  2. Answer
    Nikolay  avatar
    293 posts

    Posted 11 Nov 2019 Link to this post

    Hello Hyewon,

    This behavior is a validation feature enabled in ASP.NET MVC by default. HTML input for certain Actions or ViewModel properties could be allowed by:

    • Setting [AllowHtml] attribute on a ViewModel property allows HTML input for this property only. This is the recommended way to enable HTML input:

            [DisplayName("Product name")]
            [Remote("IsProductName_Available", "Validation")]
            public string ProductName

    • Setting [ValidateInput(false)] attribute on an Action will disable the validation on the whole Action:

            public ActionResult EditingInline_Update([DataSourceRequest] DataSourceRequest request, ProductViewModel product)
                if (product != null && ModelState.IsValid)
                return Json(new[]{product}.ToDataSourceResult(request,ModelState));

    Further read can be found at the following link:

    If there is anything else, we could help with, please contact us back.

    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Hyewon
    Hyewon avatar
    2 posts
    Member since:
    Aug 2019

    Posted 11 Nov 2019 in reply to Nikolay Link to this post

    Thanks very much! This answer solved the issue.
Back to Top