Back in "the day" of beta 1 of .NET v2, I could:
XmlNode myNode = ConfigurationSection.GetRawXml().SelectSingleNode("myNode");
Well, that GetRawXml() method has since gone away. How do I do the same thing? Brain hurts getting my head around the changes.The new model is meant to wrap the parsing and management of XML for you. In what context are you asking the question? Is this from the implementor of the ConfigurationSection or from a client wanting the read the configuration section information?
-Brock
Are you writing your own configuration section? Is that is a yes, you could try overriding DeserializeElement() method, like this:
public sealed class MySection : ConfigurationSection
{
[...]
private string _rawXml;
public string RawXml
{
get
{
return _rawXml;
}
}
protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
{
base.DeserializeElement(reader, serializeCollectionKey);
_rawXml = reader.ReadOuterXml();
}
[...]
}
Brock, I don't actually care if I can't get the actual XML as long as Ican get to the data in it, if the revised object model will allow me todo that. There are quite a few changes from beta 1 to 2 in this areaand I haven't been paying close enough attention to figure them out.
Hello.
well, now everything is better. all the sections are strongly typed and you can get them by using the Configuration API. take a look here and see if this helps:
http://beta.asp.net/QUICKSTART/aspnet/doc/management/retrieve.aspx
Here's a sample I recently put together for someone else:
http://staff.develop.com/ballen/samples/configuration20.zip
-Brock
Tuesday, March 13, 2012
Stuck on v2 ConfigurationSection class
Labels:
asp,
back,
beta,
class,
configurationsection,
couldxmlnode,
getrawxml,
mynode,
net,
selectsinglenode,
stuck
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment