hello,
i use summenote editor control and store it in sql database. and on page load event by id i again fetch the data in summer note editor control
the problem is
1. when user type any text and store in database and fetch the data on page load it shows data in summer note
2. but if user copy and paste the data from word doc or notepad and paste it in summernote control it save the data in database but when i fetch in on page load it does not show in summernote textare however data is there is sql db.
here is my complete code
html
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.9/summernote.js"></script>
<textarea id="summernote" name="editordata" style="width:100%; height:150px;"></textarea>
<script>
$(document).ready(function () {
$('#summernote').summernote();
});
</script>
page behind to insert in db
protected void Button1_Click1(object sender, EventArgs e)
{
SqlDataSource1.InsertParameters.Add("Details", name);
SqlDataSource1.Insert();
}
on page load
if (!IsPostBack)
{
if (Request.QueryString["ID"] != null)
{
DataView dview = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
if (dview.Table.Rows.Count > 0)
{
string PostDetails = (string)dview.Table.Rows[0]["PostDetails"];
var script = "document.getElementById('summernote').value='" + PostDetails + "'";
ClientScript.RegisterStartupScript(typeof(string), "Assign", script, true);
}
}
}
please advice