Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Web.Mvc;
- using Npgsql;
- namespace ThumPrint
- {
- public class AccountsController : Controller
- {
- public ActionResult Index ()
- {
- return View ();
- }
- [ActionName("Register")]
- [AcceptVerbs(HttpVerbs.Get)]
- public ActionResult Register_Get()
- {
- return View();
- }
- [ActionName("Register")]
- [AcceptVerbs(HttpVerbs.Post)]
- public ActionResult Register_Post()
- {
- /*
- * HERE IS MY PROBLEM
- * Right Here I would like to grab the values out of the TextBoxes on the
- * Web Page:
- * UserName and Password
- * How do I get these Values?
- *
- * (Thank you in advance!)
- */
- string userName = "JonDoe";
- string passWord = "bigSecret";
- try {
- if (usr.Register(userName, passWord) > 0)
- Response.Write("User Added"); // success
- } catch (NpgsqlException ex) {
- Response.Write(ex.Message);
- }
- return View("Default");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement