Advertisement
Guest User

Untitled

a guest
Jun 10th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System.Web.Mvc;
  2. using Npgsql;
  3.  
  4. namespace ThumPrint
  5. {
  6.     public class AccountsController : Controller
  7.     {
  8.         public ActionResult Index ()
  9.         {
  10.             return View ();
  11.         }
  12.        
  13.         [ActionName("Register")]
  14.         [AcceptVerbs(HttpVerbs.Get)]
  15.         public ActionResult Register_Get()
  16.         {
  17.             return View();
  18.         }
  19.        
  20.        
  21.         [ActionName("Register")]
  22.         [AcceptVerbs(HttpVerbs.Post)]
  23.         public ActionResult Register_Post()
  24.         {
  25.             /*
  26.              * HERE IS MY PROBLEM
  27.              * Right Here I would like to grab the values out of the TextBoxes on the
  28.              * Web Page:
  29.              *      UserName and Password
  30.              * How do I get these Values?
  31.              *
  32.              * (Thank you in advance!)
  33.              */
  34.             string userName = "JonDoe";
  35.             string passWord = "bigSecret";
  36.            
  37.             try {
  38.                 if (usr.Register(userName, passWord) > 0)
  39.                     Response.Write("User Added"); // success
  40.             } catch (NpgsqlException ex) {
  41.                 Response.Write(ex.Message);
  42.             }
  43.             return View("Default");
  44.            
  45.         }
  46.        
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement