Source

mvc-book-demo / PartyInvites / Views / Home / RsvpForm.cshtml

Full commit
@model PartyInvites.Models.GuestResponse

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>RsvpForm</title>
    <link rel="Stylesheet" href="@Href("~/Content/Site.css")" type="text/css" />
</head>
<body>
    <div>
        @using (Html.BeginForm()) {
            @Html.ValidationSummary()
           <p>Your name: @Html.TextBoxFor(x => x.Name) </p>
           <p>Your email: @Html.TextBoxFor(x => x.Email)
                @Html.ValidationMessageFor(x => x.Email)
           </p>
           <p>Your phone: @Html.TextBoxFor(x => x.Phone)</p>
           <p>
                Will you attend?
                @Html.DropDownListFor(x => x.WillAttend, new[] {
                new SelectListItem() {Text = "Yes, I'll be there", Value = bool.TrueString},
                new SelectListItem() {Text = "No, I can't come", Value = bool.FalseString}
                }, "Choose an option")
           </p>
                <input type="submit" value="Submit RSVP" />
        }
    </div>
</body>
</html>