protected void btnSalvar_Click(object sender, EventArgs e) { Usuario usu = new Usuario(); usu.Usu_id = Convert.ToInt32(txbId.Text); usu.Usu_nome = txbNome.Text; usu.Usu_email = txbEmail.Text; usu.Usu_senha = txbSenha.Text; usu.Perfil = new Perfil(); usu.Perfil.Per_id = Convert.ToInt32(ddlPerfil.SelectedValue); switch (UsuarioDB.Atualizar(usu)) { case 0: Response.Redirect("~/paginas/ConsultarUsuario.aspx"); break; case -2: Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script>error();</script>", false); break; } }