我正在尝试使用ASP.NET MVC3项目的derobins wmd编辑器。我已经设法添加了控件,
<script src="@Url.Content("~/WMD/showdown.js")" type="text/javascript"></script>
<link href="@Url.Content("~/WMD/wmd.css")" rel="stylesheet" type="text/css" />
......
<div id="wmd-editor" class="wmd-panel">
<div id="wmd-button-bar"></div>
@Html.TextArea("Contents", string.Empty, new
{
@class = "wmd-input"
})
<div id="wmd-preview" class="wmd-panel"></div>
</div>
.......
<script src="@Url.Content("~/WMD/wmd.js")" type="text/javascript"></script>但WDM编辑器显示不正确(无工具栏和无预览)。

请帮我解决这个问题?
发布于 2012-06-17 01:44:32
根据文档,元素的id很重要:
输入文本区
这是您将输入markdown的地方。id为"wmd-input“。
但是使用你的代码:
@Html.TextArea("Contents", string.Empty, new
{
@class = "wmd-input"
})您正在设置的文本的类别不是id。试着这样做:
@Html.TextArea("Contents", string.Empty, new
{
id = "wmd-input"
})https://stackoverflow.com/questions/11065317
复制相似问题