Use XML to Store Your App Settings in ASP

Use XML to Store Your App Settings in ASP

XML provides many opportunities to share and store data. One of the most common and simple uses of XML is to use it to store data used by your application.

Every application uses data. The traditional way to store this data was in INI files. Then came registries. Now, more and more applications use XML files to store their app settings.

With ASP, you typically store such data in the Application.Contents collection. Oftentimes, these are hardcoded into the Application_OnStart event. Rather than hardcoding these variables, you can store them in an XML file. Simply access the XML file in the Application_OnStart event to initialize the application variables. The XML file may look like this:

PropName1PropValue1PropName2PropValue2

You can also write the code to access the XML file and return an array with prop names and values in a COM component. This allows you to change any value in XML when the app is running and refresh the Application.Contents collection without having to restart the app to run the OnStart event. Simply call the Component’s method to refresh your variables!

ASP.NET uses a similar concept with a pre-created file called web.config for each ASP.NET application. This file simple XML file has a similar structure.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several