vendredi 17 juin 2016

LineControl Editor Copy from Word document Issue

I have used LineControl editor and when I try to copy paste the content from Word document. The editor gets broken.First view looks like this

then after saving and refreshing the page. it gets broken like this.

In View :

      <h4>Edit description</h4> <hr />                   
                         <textarea rows="4" cols="20" id="txtEditor"> </textarea> 
                         <div class="button-bar row center">

                            <input type="button" id="submit" class="btn btn-info" onclick="Submit()" value="Submit" />
                            <button type="button" class="btn btn-info" onclick="cancelAdd()">Cancel</button>

                       </div>
     <div id="desctext">
  @Html.Raw(HttpUtility.HtmlDecode(Model.Description)) 
                    </div>

Inside script tags

  function Submit() {
    var Id = $("#hiddendomainId").val();
    var values = $(".Editor-editor").html();

    $.ajax({
        url: '/Domain/updateDescription',
        dataType: 'json',
        type: 'POST',
        contentType: 'application/json; charset=utf-8',

        data: JSON.stringify({ id: Id, description: values }),
        success: function (response) {
            if (response.success) {


                $('#desctext').html(values);

            }
        },
        error: function (val) {
            $("#DevMessage").html('<div>Error in returning </div>');
            $("#DevMessage").addClass("alert alert-danger");
        }
    });
}
 function showContent(){

    $(".Editor-editor").html('@Html.Raw(HttpUtility.HtmlDecode(Model.Description))');
}
$(document).ready(function () {


    $("#txtEditor").Editor();
    showContent();
 });

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire