Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parent/Child Editing Ok, Not Adding
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01423691
Message ID:
01423865
Vues:
58
I got it to work, but it's kludgy and I'm sure not the proper way.

The base of the problem seems to be that the ParentKeyValue property wasn't getting properly set in the child object before its Save. So I disabled the autoSaveOnParentSaved setting, and changed my save to this:
        if (lReturn)
        {
            // Kludge! For new links
            if (this.oMemberLink.Entity.numIndID == null || this.oMemberLink.Entity.numIndID == 0)
            {
                String cIdField = (lNewContact ? "newId" : "numIndId");
                int iNewMemberId = Convert.ToInt32(this.oContact.DataSet.Tables[0].Rows[0][cIdField]);
                this.oMemberLink.Entity.numIndID = iNewMemberId;
                
                this.oMemberLink.SaveEntity();
            }
            Response.Redirect("findName.aspx?txtFind=" + this.txtLastName.Text);
        }
And hurray, it works. Now, onto the next big problem (trying to get mmCheckBoxLists to populate properly...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform