DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Web Control/Inner Property not persisting

  1. #1
    Join Date
    Aug 2006
    Posts
    6

    Lightbulb Web Control/Inner Property not persisting

    Hi -

    I've got a web control with a property defined as a persisted inner property (the inner xml of an XmlDocument exchanged as a string through this particular property).

    I can set the value in design mode within the properies window and the source code shows this initial value. However, switching back to design mode shows the property to be a zero-length string.

    The content I put in the inner property in the source code of the aspx on which the control is implemented seems to remain unaffected.

    The value set by the property does not persist at run-time either. There's other web controls in this particular library we're writing that do the same thing and work, so I'd guess there's some declaration or pecularity that I've missed!!

    Thanks,

    Rex.

    ___________

    Property declared as (C#, .NET 2):

    [Category("Data"),
    NotifyParentProperty(true),
    RefreshProperties(RefreshProperties.Repaint),
    PersistenceMode(PersistenceMode.InnerProperty)]
    public string MenuItemsXML {
    get {
    if (xmlPageContent == null) {
    xmlPageContent = new XmlDocument();
    }

    return xmlPageContent.InnerXml;
    }
    set {
    if (xmlPageContent == null) {
    xmlPageContent = new XmlDocument();
    }

    try {
    xmlPageContent.LoadXml(value);
    } catch (Exception excThis) {
    throw new ImproperXmlPropertyException("Check your menu item XML is categorised correctly:\n\n<menuItems>\n\t<menuItem id=\"name_value\">\n\t\t<label />\n\t\t<iconPath dynamic=\"true\" />\n\t\t<shortcutKey /><action type=\"function\" /></menuItem></menuItems>", excThis);
    }
    }
    }

  2. #2
    Join Date
    Aug 2006
    Posts
    6

    Thumbs up

    As is always the case on these problems, you find the solution after resorting to asking the question!!!

    I'd got a ParseChildren attribute on the web control itself, where the inner property wasn't typed to be readied by a custom designer and control builder. Simply removing the attribute from the class allowed the persistance correctly.

    Problem solved.

Similar Threads

  1. Using Java 6SE to query a web service
    By (MC3)RaVeN in forum Java
    Replies: 0
    Last Post: 03-02-2007, 10:30 AM
  2. retrieve a web service property
    By tuzojazz in forum ASP.NET
    Replies: 2
    Last Post: 09-20-2006, 11:29 AM
  3. Re: App Object (fixes)
    By Rob Teixeira in forum .NET
    Replies: 129
    Last Post: 06-06-2002, 05:23 AM
  4. Replies: 0
    Last Post: 04-19-2001, 07:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center