Exemplo n.º 1
0
        public ActionResult CustomValidatorPost(FormD form)
        {
            string ex = "";

            if (form.drpState == null && form.txtRegion == null)
            {
                ex = "Error. All fields should be filled out.";
                return(RedirectToAction("CustomValidator", "Home", new { ex }));
            }
            ex = "Validated!";
            Console.WriteLine(form);
            return(RedirectToAction("CustomValidator", "Home", new { ex }));
        }
Exemplo n.º 2
0
    void Foo()
    {
        SetNativeEnabled(false);     // defined above
        FormD f = new FormD();

        f.Closed += (s, e) => {
            switch (f.DialogResult)
            {
            case DialogResult.OK:
                // Do OK logic
                break;

            case DialogResult.Cancel:
                // Do Cancel logic
                break;
            }
            SetNativeEnabled(true);
        };
        f.Show(this);
        // function Foo returns now, as soon as FormD is shown
    }