Search code examples
javascriptc#asp.netsummernote

Not able to get the value of summernote in asp.net


I am setting the value of summernote code to hidden field but in code behind hidden field returns empty string

Javascript code

 $("#<%= txtQuestion.ClientID %>").on('summernote.blur', function () {
                    debugger;
                    let a = $('#<%= txtQuestion.ClientID %>').summernote('code');
                    document.getElementById("<%= HiddenField1.ClientID %>").innerText = a;
                console.log(a);
                });

Code Behind

string a = HiddenField1.Value;

Solution

  • You're setting innerText, you should set value.

    https://www.w3schools.com/tags/att_input_value.asp