MVC3 自定义FCKeditor

复制代码
View Code
 1  public static MvcHtmlString FckText(this System.Web.Mvc.HtmlHelper helper, string name, string width = "1150", string height = "300")
2 {
3 if (string.IsNullOrEmpty(name))
4 {
5 return MvcHtmlString.Create("name属性为必须");
6 }
7 StringBuilder strBuilder = new StringBuilder();
8 strBuilder.Append("<script tyle=\"text/javascript\">");
9 strBuilder.Append(" var f = new FCKeditor(\"" + name + "\"," + width + "," + height + ");");
10 strBuilder.Append("f.Create();");
11 //strBuilder.Append("f.value='" + value + "'");
12 strBuilder.Append("</script>");
13 return MvcHtmlString.Create(strBuilder.ToString());
14 }
复制代码

前台调用: @Html.FckText("F_DESC", "600", "300")

posted @   ミ茹此茹此↘  Views(212)  Comments(1Edit  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示