示例#1
0
        protected void updateprofile_Click(object sender, EventArgs e)
        {
            String email = emailfield.Text.ToString();
            String name  = namefield.Text.ToString();
            String gender;
            String oldemail = Session["Email"].ToString();

            if (RB1.Checked)
            {
                gender = RB1.Text.ToString();
            }
            else if (RB2.Checked)
            {
                gender = RB2.Text.ToString();
            }
            else
            {
                gender = "";
            }
            bool cekInput = cek(email, name, gender);

            if (cekInput)
            {
                Session["Email"]    = email;
                Session["UserName"] = name;
                RepositoryUser.UpdateProfile(oldemail, email, name, gender);
                Response.Redirect("ProfileMemberPage.aspx");
            }
            else
            {
                Response.Write("<script>alert('Data can not be null.')</script>");
            }
        }