示例#1
0
        public void Init()
        {
            var  contact = new Contact();
            bool sent    = false;

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

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

            layout(new { contact, sent });
        }