我正在开发一个应用程序并在其中添加富文本编辑器,但它不起作用。我也尝试过许多其他编辑器,例如 tinyMC 或 CK Editor,但它也无法正常工作。所以这就是我提供代码以便任何人都可以帮助我的原因。代码如下
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Tabs.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="titleContent" runat="server">
PostProblem
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript"> bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
<script type="text/javascript">
$("#PostProblem").validate();
</script>
<h3>PostProblem</h3>
<br />
<% using (Html.BeginForm("PostProblem", "Discussion", null ,FormMethod.Post, new { id = "PostProblem" }))
{ %>
<table class="bodyTable">
<tbody class="rowHover">
<tr>
<td class="labelPortion">
Title:
</td>
<td class="controlPortion">
<%: Html.RenderControl(new ControlInfo()
{
ControlID = 1,
CanNull = false,
Type = ControlType.TextField,
Value = (TempData["__1"] != null) ? TempData["__1"].ToString() : ""
}, true
)
%>
<% // Display the error message if any.
if (TempData["_1"] != null)
{ %><br/>
<span class="errorMessage"> <%: TempData["_1"]%> </span>
<% } %>
</td>
</tr>
<tr>
<td class="labelPortion">
Problem:
</td>
<td class="controlPortion">
<%: Html.RenderControl(new ControlInfo()
{
ControlID = 3,
CanNull = false,
Type = ControlType.TextArea,
Value = (TempData["__3"] != null) ? TempData["__3"].ToString() : ""
}, true
)
%>
<% // Display the error message if any.
if (TempData["_3"] != null)
{ %>
<br/>
<span class="errorMessage"> <%: TempData["_3"]%> </span>
<% } %>
</td>
</tr>
<tr>
<td class="labelPortion">
<b>Problem Tag:</b>
</td>
<td class="controlPortion">
<%: Html.DropDownList("selectedValue", (IEnumerable<SelectListItem>)ViewData["problemTags"])%>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input class="buttonDesign" type="submit" value="Post"/>
</td>
</tr>
</tbody>
</table>
<%} %>
</asp:Content>
请帮我。