TinyMCE - 没有在ASP.NET中使用代码获取文本框值

时间:2016-04-15 12:17:51

标签: asp.net vb.net tinymce

我有以下简单的代码,当我试图获取文本框值时,它总是空白。

ASPX

<asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" CssClass="editor"></asp:TextBox>

function SetEditor() {
    tinymce.init({
        selector: "textarea.editor",
        theme: "modern",
        height: 450,    
        plugins: [
        "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
        "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
        "save table contextmenu directionality emoticons template paste textcolor"
        ],
        toolbar: "insertfile undo redo | styleselect | fontselect fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons",
        style_formats: [
    { title: 'Bold text', inline: 'b' },
    { title: 'Red text', inline: 'span', styles: { color: '#ff0000' } },
    { title: 'Red header', block: 'h1', styles: { color: '#ff0000' } },
    { title: 'Example 1', inline: 'span', classes: 'example1' },
    { title: 'Example 2', inline: 'span', classes: 'example2' },
    { title: 'Table styles' },
    { title: 'Table row 1', selector: 'tr', classes: 'tablerow1' }
        ]
    });
}

SetEditor();

ASPX.VB

Dim content as string = txtComment.Text 'It always blank

0 个答案:

没有答案