在tinymce内使用RazorEngine

在tinymce内使用RazorEngine,razor,tinymce,razorengine,Razor,Tinymce,Razorengine,我正在编写一个应用程序,它使用给定的电子邮件模板生成多条消息 电子邮件解析器工作正常。我正在使用RazorEngine创建电子邮件模板 问题是我需要使用以下构造(一个简单的foreach)生成一个表: 从3.4开始,不再可能使用配置设置关闭tinymce验证程序。 html需要有效,但您可以定义tinymce验证器接受为有效的内容和不接受的内容。仔细查看tinymce config参数valid_元素和valid_子元素 <table> <tbody> <tr>

我正在编写一个应用程序,它使用给定的电子邮件模板生成多条消息

电子邮件解析器工作正常。我正在使用RazorEngine创建电子邮件模板

问题是我需要使用以下构造(一个简单的foreach)生成一个表:


从3.4开始,不再可能使用配置设置关闭tinymce验证程序。 html需要有效,但您可以定义tinymce验证器接受为有效的内容和不接受的内容。仔细查看tinymce config参数valid_元素和valid_子元素

<table>
<tbody>
<tr><th>Pedido</th><th>NF</th><th>Boleto</th><th>Vencimento</th><th>Valor</th></tr>
@foreach (dynamic item in Model.PagamentosEmAtraso) {
<tr>
<td valign="top" width="76">
<p align="center"><span style="font-size: small;">@item.NumeroPedido</span></p>
</td>
<td valign="top" width="60">
<p align="center"><span style="font-size: small;">@item.NumeroNotaFiscal</span></p>
</td>
<td valign="top" width="88">
<p align="center"><span style="font-size: small;">@item.NumeroBoleto</span></p>
</td>
<td valign="top" width="128">
<p align="center"><span style="font-size: small;">@item.DataVencimento.ToString("dd/MM/yyyy")</span></p>
</td>
<td valign="top" width="119">
<p align="center"><span style="font-size: small;">@item.ValorLiquido.ToString("C2") </span></p>
</td>
</tr>
}
</tbody>
</table>
@foreach (dynamic item in Model.PagamentosEmAtraso) {}
<table>
function initializeTinyMce() {
    $('textarea.tinymce').tinymce({
        // Location of TinyMCE script
        script_url: '/Scripts/tinymce/tiny_mce.js',

        // General options
        theme: "advanced",
        plugins:  " pa geb reak,legacyoutput,style,layer,table,save,advimage,advlink,emotions,iespell,inlinepopups,preview,media,searchreplace,print,c  o nt extmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
        width: "960",
        height: "500",
        entity_encoding: "raw",


        // Theme options
        theme_advanced_buttons1:  " bo ld, italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontse  l ec t,fontsizeselect",
        theme_advanced_buttons2:  " cu t,c opy,paste,pastetext,pasteword,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,image,cleanup,help,code,|,insert  d at e,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,||,fullscreen",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",
        theme_advanced_resizing: true,

        // Example content CSS (should be your site CSS)
        //content_css: "/Content/site.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url: "lists/template_list.js",
        external_link_list_url: "lists/link_list.js",
        external_image_list_url: "lists/image_list.js",
        media_external_list_url: "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values: {
            username: "Some User",
            staffid: "991234"
        }           
    });
 }