Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 596321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:09:35+00:00 2026-05-13T16:09:35+00:00

How do i write something in the innertext of my xml file i am

  • 0

How do i write something in the innertext of my xml file

i am able to read the particualar tag from the file like this:

 protected void Page_Load(object sender, EventArgs e)
    {// this is to read from xml.
        if (!Page.IsPostBack)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(@"C:\configfolder\config.xml");

            XmlNodeList portNo = xmlDoc.GetElementsByTagName("AgentConfigRepository");
            foreach (XmlNode node in portNo)
            {
                XmlElement bookElement = (XmlElement)node;
                string no = bookElement.GetElementsByTagName("OVERRIDE_CONFIG_FILE_NAME")[0].InnerText;
                TextBox1.Text = no;
            }
        }
    }

Now i want to change the value in the innertext of OVERRIDE_CONFIG_FILE_NAME

this is how my xml file looks like:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<AgentConfigRepository>
  <SERVER_SHARE_SW_DIR_NAME val="singleVal">AgentSW</SERVER_SHARE_SW_DIR_NAME>
  <OVERRIDE_CONFIG_FILE_NAME val="singleVal">override_config.xml</OVERRIDE_CONFIG_FILE_NAME>
  <MAINTAIN_AGENT_SW_LEVEL val="singleVal">1.0</MAINTAIN_AGENT_SW_LEVEL>
  <MAINTAIN_AGENT_SW_PATCH_LEVEL val="singleVal">0</MAINTAIN_AGENT_SW_PATCH_LEVEL>
</AgentConfigRepository>

so i want to change override_config.xml to some other value in the textbox.

any suggestions.. thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:09:35+00:00Added an answer on May 13, 2026 at 4:09 pm

    If you can use XDocument, it becomes pretty trivial:

    XDocument xdoc = XDocument.Load(@"C:\configfolder\config.xml");
    xdoc.Root.Element("OVERRIDE_CONFIG_FILE_NAME").SetValue("HelloThere");
    xdoc.Save(@"C:\so2.xml");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Eg. can I write something like this code: public void InactiveCustomers(IEnumerable<Guid> customerIDs) { //...
I often find I want to write code something like this in C#, but
In C# I can write something like this: enum MyEnum : byte { Value1,
I would like to be able to write something like char f(char); vector<char> bar;
I would ideally like to write something like this: myValue1 = 1 :: Int
I often want to write something like this: new Form { Text = Caption,
I need to write something like this: private Set processedLinks = new HashSet(); public
I am trying to write something like this [(x,y)|x<- [1,2,3], y <- [’a’,’b’]] =>
I am trying to write something like this: #define COV_ON(x) \ #ifdef COVERAGE_TOOL \
I want to write something like this: http://www.youtube.com/watch?v=5S4KpCkHDqM I mean, I want to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.