Copied to clipboard

Flag this post as spam?

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


  • Diogo 9 posts 40 karma points
    May 16, 2014 @ 16:10
    Diogo
    0

    Working with member property autocomplete

    Hey guys i have a member property witch is sql:Autocomplete (ucompononentes) umbraco v6. And what is saved in that is field is a xml file or a simulation of it , and this is how i edit if ! PS: this only works if i already got something there so i can Parse it and just add new line in xml. 

    using System.Xml.Linq;        

    XDocument xDocument = XDocument.Parse(member.getproperty("alias").value.ToString());

    xDocument
    .Root.Add(new XElement(
                               
    "Item",
                               
    new XAttribute("Text", "some text"),
                               
    new XAttribute("Value", "some value")));

    member
    .getproperty("alias").value = xDocument.ToString();

    But in the field if i have nothing and i need to start something i cant, its not stored.. cant understand why.. if u can help me pls tell. i already tryed this

    XDocument doc = new XDocument();
                                       doc.Root.Add(
                                            new XElement("SqlAutoComplete",
                                              new XElement( "Item",
                                               new XAttribute("Text", "lol"),
                                               new XAttribute("Value", "123"))));
                                        
                                        member.getProperty("alias").Value = doc.ToString();
Please Sign in or register to post replies

Write your reply to:

Draft