Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="post">
- First name:<br>
- <input type="text" name="firstname" autocomplete="on" maxlength="10" required><br>
- Last name:<br>
- <input type="text" name="lastname" autocomplete="on" maxlength="10" required><br>
- Employee number:<br>
- <input type="text" name="empnum" maxlength="10">
- <br>
- <br>I agree to the terms above:<br>
- <input type="checkbox" name="check" required>
- <button type="submit" asp-page-handler="SubmitAndRedirect">Submit and Redirect</button>
- </form>
- public ActionResult OnPostSubmitAndRedirect()
- {
- //Capture Form Data and Push to SQL DB
- var firstname = Request.Form["firstname"];
- var lastname = Request.Form["lastname"];
- var empnum = Request.Form["empnum"];
- bool isValidUser = ValidateUser(empnum, lastname);
- if (isValidUser == true)
- {
- WriteToDB(firstname, lastname, empnum, url);
- return Redirect(hardcoded);
- }
- else
- {
- return Redirect("/sign");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement