gpt4 book ai didi

javascript - 使用 javascript 添加 RadEditor :getting unterminated string literal error

转载 作者:行者123 更新时间:2023-11-30 00:28:38 25 4
gpt4 key购买 nike

var editCommentDiv = '<div id="divTicketCommentHistoryEditor">';
editCommentDiv += '<br />';
editCommentDiv += '<telerik:RadEditor ID="editorCommentsHistory" runat="server" EditModes="Design" ToolbarMode="ShowOnFocus" ToolsWidth="170px" Width="412px" Height="72px"></telerik:RadEditor>';

editCommentDiv += '<div>';
editCommentDiv += '<input id="cbEditIsPrivate" type="checkbox" />Make Comment/Note Private';
editCommentDiv += '&nbsp;';
editCommentDiv += '<a href="javascript:void(0)" onclick="return editCommentSave();">Update</a>';
editCommentDiv += '<a href="javascript:void(0)" onclick="return editCommentCancel();">Cancel</a>';
editCommentDiv += '</div></div>';

我在这里得到未终止的字符串文字

<telerik:RadEditor ID="editorCommentsHistory" runat="server" EditModes="Design" ToolbarMode="ShowOnFocus" ToolsWidth="170px" Width="412px" Height="72px"></telerik:RadEditor>' 

最佳答案

    public string editor(){
RadEditor editor = new RadEditor();
editor.ID = "radeditor";
//provide all the properties and toolbar options
StringWriter sw = new StringWriter();
HtmlTextWriter htWriter =new HtmlTextWriter(sw);
editor.RegisterWithScriptManager = false;
this.Controls.Add(editor);
editor.RenderControl(htWriter);

string strRenderedHTML = sw.ToString();
return strRenderedHTML;
}

最后将返回的字符串存储在一个隐藏字段中(包含Radeditor的所有html)并在.aspx页面中获取值。

editCommentDiv += hiddenfield.value..

关于javascript - 使用 javascript 添加 RadEditor :getting unterminated string literal error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30481877/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com