Пример #1
0
        public void Init()
        {
            var  contact = new Contact();
            bool sent    = false;

            if (IsPost &&
                AntiForgery.TryValidateAsync(Context).Result &&
                TryBind(contact) &&
                SendMail(contact))
            {
                sent = true;

                // clear form
                ModelState.Clear();
                contact = new Contact();
            }

            layout(new { contact, sent, antiforgery });
        }