protected void btnSave_Click(object sender, EventArgs e) { TextBox txtUserID = DetailsView1.FindControl("txtUserID") as TextBox; TextBox txtUserName = DetailsView1.FindControl("txtUserName") as TextBox; DropDownList dropUserRole = DetailsView1.FindControl("dropUserRole") as DropDownList; TextBox txtUserStatus = DetailsView1.FindControl("txtUserStatus") as TextBox; TextBox txtUserLoginDate = DetailsView1.FindControl("txtUserLoginDate") as TextBox; TextBox txtWrongAttempts = DetailsView1.FindControl("txtWrongAttempts") as TextBox; int userID = Convert.ToInt32(txtUserID.Text.ToString()); string userName = txtUserName.Text.ToString(); string userRole = dropUserRole.SelectedValue.ToString(); string userStatus = txtUserStatus.Text.ToString(); string userLoginDate = txtUserLoginDate.Text.ToString(); string wrongAttempts = txtWrongAttempts.Text.ToString(); Debug.WriteLine(""); Debug.WriteLine("Data From Grid:"); Debug.WriteLine("User ID: " + userID); Debug.WriteLine("User Name: " + userName); Debug.WriteLine("User Type: " + userRole); Debug.WriteLine("User Status: " + userStatus); Debug.WriteLine("User Login Date: " + userLoginDate); Debug.WriteLine("User Wrong Attempts: " + wrongAttempts); DatabaseConnectivity dbcon = new DatabaseConnectivity(); int res = dbcon.setAUser(userID, userName, userRole, userStatus, userLoginDate, wrongAttempts); //nt ResultQuery = dbcon.setAClient(userID, userName, userRole, userStatus, userLoginDate, wrongAttempts); //Console.WriteLine("<script>alert(" + ResultQuery + "record has been updated." + ")</script>"); //ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery + "record has been updated." + ")</script>", true); //ScriptManager.RegisterStartupScript(this, this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery +")</script>", true); DetailsView1.Visible = false; //DetailsView1.Style.Add("display", "none"); _BindService(); }