protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { GuestResponse rsvp = new GuestResponse(); if (TryUpdateModel(rsvp, new FormValueProvider(ModelBindingExecutionContext))) { ResponseRepository.GetRepository().AddResponse(rsvp); if (rsvp.WillAttend.HasValue && rsvp.WillAttend.Value) Response.Redirect("seeyouthere.html"); else Response.Redirect("sorryyoucantcome.html"); } } }
public void AddResponse(GuestResponse response) { responses.Add(response); }