富文本编辑器 TinyMCE 是一个很好用的富文本编辑器,本人菜鸟一只,下面是一个简单的例子。
首先先去官网下载 TinyMCE 的js文件,放在asp.net mvc工程项目里面:

然后在controller里面创建一个页面,姑且简单的就直接叫做Home.Index页面吧。
public class HomeController : Controller
{
//测试首页
public ActionResult Index()
{
return View();
}
//保存方法
[HttpPost]
[ValidateInput(false)]
public ActionResult SaveInfo()
{
string textValue = Request.Form["textContent"];
return Content("save success");
}
}
然后开始编辑前端html和js
@{
Layout = null;
}
Index
可以看到