Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kannandesikan 48 posts 68 karma points
    Nov 12, 2012 @ 08:19
    kannandesikan
    0

    childnode not able to retrive

    Hi,

     

    we working in examine search in umbraco, we try to retrive childname name,pls find below code, we are using

    user control in csharp

     

    We try to get schools Searching , As we tried to get the node using e.Fields.Add(“schools”, schools). We could not get the  node(school)  name.

     

    Looking for the Suggestion to overcome with this issue.

     

     

     

     

               if (e.Node.ExamineNodeTypeAlias().Equals("LawyerBio"))

                {

                    var node = uQuery.GetNode(e.NodeId);

                    if (node != null)

                    {

                        IEnumerable<Node> SchoolName = node.GetChildNodesByType("LawyerBio");

                        if (SchoolName.Any())

                        {

                            IEnumerable<Node> EductationNode = SchoolName.First().GetChildNodesByType("Education");

                            var School = new StringBuilder();

                            if (SchoolName.First().HasProperty("school"))

                            {

                                School.Append(SchoolName.First().GetPropertyAsString("school"));

                                foreach(Node test in EductationNode)

                                {

                                    School.Append(test.GetPropertyAsString("school"));

                                }

                                e.Fields.Add("School", School.ToString());  

                            }

                        }

                    }

                }

Please Sign in or register to post replies

Write your reply to:

Draft