Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Prevent logged in users from accessing the registration page
            if (Session["id"] != null)
            {
                Response.Redirect("./index.aspx"); return;
            }

            if (HttpContext.Current.Request.HttpMethod == "POST")
            {
                AuctionDB db = new AuctionDB();
                try
                {
                    db.CreateUser(Request.Form["username"], Request.Form["password"], Request.Form["email"]);
                    Response.Write("Username " + Request.Form["username"] + " was added to the database.");
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }

                /*
                 * foreach (string key in Request.Form.AllKeys)
                 * {
                 *
                 * }
                 */
            }
        }