Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
31 lines (27 sloc) 786 Bytes
using System.Net;
using System.Web.Mvc;
using CoreySmith.Feature.Forms.Models;
using Newtonsoft.Json;
using Sitecore.LayoutService.Mvc.Security;
namespace CoreySmith.Feature.Forms.Controllers
public class JssRocksFormController : Controller
private static string _name;
public ActionResult Form()
var model = new { name = _name };
return Content(JsonConvert.SerializeObject(model), "application/json");
public ActionResult Form(JssRocksFormData form)
if (!ModelState.IsValid) return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
_name = $"{form.Name} (MVC)";
return new HttpStatusCodeResult(HttpStatusCode.OK);