protected void btnSignup_Click(object sender, EventArgs e) { try { DbManager dbmanager = new DbManager(); Member member = new Member(); member.UserName = txtUsername.Text; member.Password = txtPassword.Text; member.Email = txtEmail.Text; int id = dbmanager.AddMember(member); if (id > 0) { lblErrorMsg.Visible = true; lblErrorMsg.Text = "Successfully registered. Please login in to continue."; Response.Redirect("/Default.aspx"); } else { lblErrorMsg.Visible = true; lblErrorMsg.Text = "Something went wrong. Error:"; } } catch (Exception e) { lblErrorMsg.Visible = true; lblErrorMsg.Text = "Something went wrong. Error:" + e.Message; } }