Create the view

  1. In the Mvc/Views folder, create a new CSHTML file and name it Default.

  2. Open the Default.cshtml file and add the following code:

    Razor
    @model SitefinityWebApp.Mvc.Models.CustomFormWidgetModel
    
    @using (Html.BeginForm("Submit", "CustomFormWidget", FormMethod.Post, new { id = "custom-dinner-request-form" }))
    {
        <div>
            @Html.LabelFor(m => m.Email)
            @Html.TextBoxFor(m => m.Email)
        </div>
        <div>
            @Html.LabelFor(m => m.FirstMeal)
            @Html.TextBoxFor(m => m.FirstMeal)
        </div>
        <div>
            @Html.LabelFor(m => m.SecondMeal)
            @Html.TextBoxFor(m => m.SecondMeal)
        </div>
        <div>
            @Html.LabelFor(m => m.Dessert)
            @Html.TextBoxFor(m => m.Dessert)
        </div>
        <div>
            <input type="submit" value="Submit your dinner request">
        </div>
    }