ASP. net xml file processing tutorial

Source: Internet
Author: User

We can integrate an XML file into the configuration control.

Example
For example, 1-x ml r adiobuttonList

An XML file
This is an XML file named "countries. xml ":

<? Xml version = "1.0" encoding = "ISO-8859-1"?>
<Countries>
<Country>
<Text> Norway </text>
<Value> N </value>
</Country>
<Country>
<Text> Sweden </text>
<Value> S </value>
</Country>
<Country>
<Text> France </text>
<Value> F </value>
</Country>
<Country>
<Text> Italy </text>
<Value> I </value>
</Country>
</Countries>
Look at the XML file: countries. xml ---------------------------------------------------------------------- bind a DataSet to the control list first, import the "System. Data" namespace. We need this name and DataSet object. Includes one of the following commands. Aspx page: <% @ Import Namespace = "System. data "%> Next, create a DataSet XML file and load the XML file to the DataSet webpage. Load the file first: <script runat =" server ">
Sub Page_Load
If Not Page. IsPostBack then
Dim mycountries = New DataSet
Mycountries. ReadXml (MapPath ("countries. xml "))
End if
End sub binds data to the RadioButtonList control. First, it creates a RadioButtonList control (without any ASP: ListItem element. Aspx page: html>
<Body> <form runat = "server">
<Asp: RadioButtonList id = "rb" runat = "server"
AutoPostBack = "True"/> </form> </body>
</Html> Then add the script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.