2013-03-24 84 views
1

我有一个包含HTML标签的RitchText编辑器,我在想我是否可以在我的ASPX页面中显示所有这些标签的文本区域,并且它应该是可编辑的。在可编辑文本区域显示HTML内容

我假设正常的文本框不是这里的选项,

有什么建议吗?

+1

考虑使用TinyMCE的丰富的编辑 – Karisters 2013-03-24 13:31:33

+0

@Karisters我相信MarlItDown远不如 – 2013-03-24 13:38:39

+0

要解决此问题,使用以下螺纹: http://stackoverflow.com/questions/15607993/tinymce-text-editor-is- not-loading-my-text – 2013-03-26 10:08:28

回答

0

页面内添加TinyMCE的是把戏。

0

检查了这一点......我把它放在控制台,因此它会更容易undersand:

using System; 
using System.Net; 

class Program 
{ 
    static void Main() 
    { 
    string a = WebUtility.HtmlEncode("<html><head><title>T</title></head></html>"); 
    string b = WebUtility.HtmlDecode(a); 

    Console.WriteLine("After HtmlEncode: " + a); 
    Console.WriteLine("After HtmlDecode: " + b); 
    } 
} 
+0

解码和编码与我所寻找的完全不同。 – 2013-03-24 13:40:32

0

您可以使用jQuery + jQuery UI的变换一个普通的文本标签,如“P”到一个文本框,在这里,我建立了一个例子:

http://jsfiddle.net/jXXgG/

$(function() { 
var availableTags = [ 
    "ActionScript", 
    "AppleScript", 
    "Asp", 
]; 

$("#tag").hide(); 

$("#tags").autocomplete({ 
    source: availableTags 
}); 

$("#tag").click(function(){ 
    $("#tags").val($(this).text()); 
    $(this).hide(); 
    $("#tags").show(); 
});  

$("#tags").blur(function() { 
    $("#tag").text($(this).val()); 
    $(this).hide(); 
    $("#tag").show(); 
}); 
+0

我不想摆脱标签。 – 2013-03-24 15:57:03

0

道歉,如果我误解你了。

如果您在Umbraco文档类型中添加标准的'Richtext Editor'作为字段'类型' - 那么您可以通过点击顶部的'html'来访问和编辑Umbraco后台的html标签编辑栏,而你在你的重点领域的富文本:

enter image description here

+0

感谢您的回复。 其实我想做的是在我的实际网页上,而不是Umbraco控制面板。 要解决我使用此线程的问题:http://stackoverflow.com/questions/15607993/tinymce-text-editor-is-not-loading-my-text – 2013-03-26 10:04:04