Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. public ActionResult Form(string name, string surname, string email, string sex, string[] hobbies)
  2.         {
  3.             if (HttpContext.Request.HttpMethod == "GET")
  4.             {
  5.                 return View();
  6.             }
  7.             else if (HttpContext.Request.HttpMethod == "POST")
  8.             {
  9.                 var formResult = new FormResult(name,surname,email,sex,hobbies);
  10.                 return View("FormResult",formResult);
  11.             }
  12.  
  13.             return HttpNotFound();
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement