I am building a web application where I have to read some values from the config file which I am assuming as nothing but an XML file. So in this process I am able to read the XML document using
XDocument config = XDocument.Load("\\path\to\example.exe.config");
Now I have a textbox in my web page. I want to get a specific value into that textbox where the user can edit and update that value in the textbox.
Can any one guide me to the solution?
Using C#, Linq to XML, Asp.net
Well you have an
XDocument, so you can use Linq to XML to query it for the value. Put that in the textbox when the page is rendered. Of course when you POST the value you’ll have to load the file a second time, query theXDocumentagain, and then update the XML element with the new value before saving.