First Sitecore Form


Struggled a bit while creating a Sitecore form on a page. Here is how to add it.

First, we need an MVC layout.

@using Sitecore.Mvc;
@using Sitecore.Mvc.Analytics.Extensions;


    Layout = "MvcOuterLayout.cshtml";



<div id="container">
    <div class="scfForm iframe-form">

Here is the code for MVC outer layout:

@using Sitecore.Mvc;
@using Sitecore.ExperienceForms.Mvc.Html;
@using Sitecore.Mvc.Analytics.Extensions;
    Layout = null;
<!DOCTYPE html>
<html lang="en" xmlns="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Sitecore Form</title>
    <link rel="stylesheet" type="text/css" href="/css/theme.css" media="screen">
    <link rel="stylesheet" type="text/css" href="/css/modules.css" media="screen">
        body {
            background: none;

Now add MVCLayout as Layout in Sitecore and MVC Form rendering with placeholder "main"