Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Custom Configuration Section

Reply
Thread Tools

Custom Configuration Section

 
 
partysingh
Guest
Posts: n/a
 
      01-27-2010
Hi Folks,

I want to create a custom configuration section for getting the
request and response xmls for my application:

I want the format for it as:

<RequestResponseCollection>
<RequestResponse name="A">
<Request path="fileA.xml" />
<Response path="fileB.xml" />
</RequestResponse>
<RequestResponse name="B">
<Request path="fileC.xml" />
<Response path="fileD.xml" />
</RequestResponse>
</RequestResponseCollection>

I able to travese till RequestResponse. Please let me know how to
create the inner element to it.

I am using Dot Net 3.5.

Thanks,
 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      01-27-2010
On Jan 27, 4:45*pm, partysingh <(E-Mail Removed)> wrote:
> Hi Folks,
>
> I want to create a custom configuration section for getting the
> request and response xmls for my application:
>
> I want the format for it as:
>
> <RequestResponseCollection>
> * * * * <RequestResponse name="A">
> * * * * * * * * <Request path="fileA.xml" />
> * * * * * * * * <Response path="fileB.xml" />
> * * * * </RequestResponse>
> * * * * <RequestResponse name="B">
> * * * * * * * * <Request path="fileC.xml" />
> * * * * * * * * <Response path="fileD.xml" />
> * * * * </RequestResponse>
> </RequestResponseCollection>
>
> I able to travese till RequestResponse. Please let me know how to
> create the inner element to it.
>
> I am using Dot Net 3.5.
>
> Thanks,


If it's an XmlDocument then

XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml...
XmlNode xn = xDoc.SelectSingleNode("//RequestResponseCollection/
RequestResponse[@name='A']");

XmlNode newSub = xDoc.CreateNode(XmlNodeType.Element, "Request",
null);
XmlAttribute xa = xDoc.CreateAttribute("path");
xa.Value = "fileA.xml";
newSub.Attributes.Append(xa);
xn.AppendChild(newSub);

and the same for <Response>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enterprise Library exception: The configuration section securityCryptographyConfiguration is not defined in the current configuration for the AppDomain. Jess Chadwick ASP .Net 1 09-21-2006 09:18 AM
Custom configuration section handlers with Namespaces =?Utf-8?B?cmRjcHJv?= ASP .Net 3 02-02-2005 01:51 AM
Exception in configuration section handler using a Custom ConfigurationHandler murl ASP .Net 2 09-01-2004 07:37 AM
Custom configuration section handlers Nick Gilbert ASP .Net 4 07-14-2004 09:43 AM
Declaring custom configuration section. Mauricio ASP .Net 3 08-22-2003 07:26 PM



Advertisments