How do I use ACE with my ASP.NET MVC application?

前端 未结 3 1970
孤城傲影
孤城傲影 2021-02-14 03:32

I want to use the ACE online code editor in my project. How do I use it in ASP.NET MVC?

I\'d like to save whatever edits are made with that editor in the database. How d

3条回答
  •  不要未来只要你来
    2021-02-14 04:21

    This is how I ended up doing it in Razor Views

    @model OfficeGx.Cms.Model.ClassName
    
    @Html.HiddenFor(x => x.CascadingStylesHdn, new { @id = "hidden_cssEditor" }) @Html.LabelFor(x=>x.CascadingStyles)
    @Model.CascadingStyles
    @Html.HiddenFor(x => x.JavaScriptHdn, new { @id = "hidden_jsEditor" }) @Html.LabelFor(x => x.JavaScript)
    @Model.JavaScript

    In my Controller Add/Edit Method

    [HttpPost]
            [ValidateInput(false)]
            public ActionResult AddEdit(Article article, FormCollection formCollection)
            {
                article.CompanyId = OperatingUser.CompanyId;
                article.CascadingStyles = article.CascadingStylesHdn;
                article.JavaScript = article.JavaScriptHdn;
    

提交回复
热议问题