Custom Configuration Section

Discussion in 'ASP .Net' started by partysingh, Jan 27, 2010.

  1. partysingh

    partysingh Guest

    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,
    partysingh, Jan 27, 2010
    #1
    1. Advertising

  2. On Jan 27, 4:45 pm, partysingh <> 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>
    Alexey Smirnov, Jan 27, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mauricio
    Replies:
    3
    Views:
    1,196
    Mauricio
    Aug 22, 2003
  2. Nick Gilbert

    Custom configuration section handlers

    Nick Gilbert, Jul 13, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    663
    Steven Cheng[MSFT]
    Jul 14, 2004
  3. murl
    Replies:
    2
    Views:
    668
    =?Utf-8?B?UGF1bCBNLg==?=
    Sep 1, 2004
  4. =?Utf-8?B?cmRjcHJv?=

    Custom configuration section handlers with Namespaces

    =?Utf-8?B?cmRjcHJv?=, Jan 31, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    732
    Steven Cheng[MSFT]
    Feb 2, 2005
  5. TDAVISJR

    custom configuration section handler

    TDAVISJR, Apr 26, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    454
    jsh02_nova
    Apr 27, 2005
Loading...

Share This Page