Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack)
        {
            string user_name = Request.Form["user_name"];
            string first_name = Request.Form["first_name"];
            string last_name = Request.Form["last_name"];
            string password = Request.Form["password"];
            string male = Request.Form["male"];
            string email = Request.Form["email"];
            

            
            SqlUtility util = new SqlUtility();
            if (util.CreateUser(user_name, first_name, last_name, password, male, email))
            {
                Session["username"] = user_name;
                Response.Redirect("profilepage.aspx");
            }
            else
            {
                Response.Write("<script type=\"text/javascript\">alert('user already exists')</script>");
            }
        }//if
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack)
        {
            string user_name  = Request.Form["user_name"];
            string first_name = Request.Form["first_name"];
            string last_name  = Request.Form["last_name"];
            string password   = Request.Form["password"];
            string male       = Request.Form["male"];
            string email      = Request.Form["email"];



            SqlUtility util = new SqlUtility();
            if (util.CreateUser(user_name, first_name, last_name, password, male, email))
            {
                Session["username"] = user_name;
                Response.Redirect("profilepage.aspx");
            }
            else
            {
                Response.Write("<script type=\"text/javascript\">alert('user already exists')</script>");
            }
        }//if
    }