|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to parse deeper nested tags in custom controlcan any one please redirect me to how to use control builder class to parse
the following case (or any other method) <mycustomcontroltag> <item attribute1="x" attribute2="y" ......> <subitems> <item attribute1="xx" attribute2="yy" ......> <subitems> more deeper nested tags can be here </subitems> </item> </subitems> </item> more item tags with deeper nested sub tags can be here </ycustomcontroltag> I'd suggest looking into the various attributes that control the paraser
such as ParseChildren and PersistenceMode. With those 2 I think you can get the nesting you're looking for there. Also, I'd suggest checking out "Developing Microsoft ASP.NET Server Controls and Components", Nikhil Kothari, Vandana Datye: http://www.amazon.com/gp/product/0735615829/104-2260158-2667120?v=glance&n=283155&n=507846&s=books&v=glance -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > can any one please redirect me to how to use control builder class to > parse > the following case (or any other method) > <mycustomcontroltag> > <item attribute1="x" attribute2="y" ......> > <subitems> > <item attribute1="xx" attribute2="yy" ......> > <subitems> > more deeper nested tags can be here > </subitems> > </item> > </subitems> > </item> > more item tags with deeper nested sub tags can be here > </ycustomcontroltag> Brock,
You are totalement right. I just added [ParseChildren(true)] [PersistChildren(false)] to both classes and [PersistenceMode(PersistenceMode.InnerProperty)] to the properties and it worked Thanks a lot. by the way i could not registered in your blog, is it possible or not? Show quoteHide quote "Brock Allen" wrote: > I'd suggest looking into the various attributes that control the paraser > such as ParseChildren and PersistenceMode. With those 2 I think you can get > the nesting you're looking for there. Also, I'd suggest checking out "Developing > Microsoft ASP.NET Server Controls and Components", Nikhil Kothari, Vandana > Datye: > > http://www.amazon.com/gp/product/0735615829/104-2260158-2667120?v=glance&n=283155&n=507846&s=books&v=glance > > -Brock > DevelopMentor > http://staff.develop.com/ballen > > > can any one please redirect me to how to use control builder class to > > parse > > the following case (or any other method) > > <mycustomcontroltag> > > <item attribute1="x" attribute2="y" ......> > > <subitems> > > <item attribute1="xx" attribute2="yy" ......> > > <subitems> > > more deeper nested tags can be here > > </subitems> > > </item> > > </subitems> > > </item> > > more item tags with deeper nested sub tags can be here > > </ycustomcontroltag> > > >
Other interesting topics
ASP.NET 2.0 Frustration - MS Please Help
TreeView problem ASP.NET does not honor Title nor Javscript options Odd behavior in 2005 with base page classes Web.Config file seems to be ignored Accessing session from thread Forms authentication with images on the login page Wizard Control Problem migrating Web Project from ASP.Net 1.1 to 2.0 Conditional directive |
|||||||||||||||||||||||