Add Control to a Project

Follow the steps below to add a Spreadsheet to a web page:

  1. Create a new controller or open an existing controller (for example, the HomeController.cs file), and add an action that handles document commands as shown below:
using DevExpress.AspNetCore.Spreadsheet;
...
public class HomeController : Controller
{
    [HttpPost]
    [HttpGet]
    public IActionResult DxDocRequest() {
        return SpreadsheetRequestProcessor.GetResponse(HttpContext);
    }
     /// ...
}
  1. Use the Spreadsheet helper to add a spreadsheet to a Razor file (.cshtml):
@(Html.DevExpress()
    .Spreadsheet("spreadsheet")
    .DocumentRequestHandlerUrl(Url.Action("DxDocRequest")))