ASP.NET practicing the first training [Learn .NET common control and XML data processing]

xiaoxiao2021-03-06  36

Learning Topic: Menu Level 2 Interaction with XML Data Process Learning Purpose: Learning .NET's Common Control DROPDOWNLIST, TEXTBOX, LABEL, button control uses how to read XML data in .NET and how to use XPath statement query to process XML data learning Tip: In .NET, use the XMLReader, XMLWRITER, XMLDocument such as System.xml namespace, etc., so import system.xml namespaces in this exercise. Several special queries in the XPath statement Note (?): Note The following is my instructions, is not a professional instructions. So explain that it is possible to misunderstand (-_) //: This tag is indicating the reference root space, the root node space of XML. In XML It can only have a root root node space. /: This tag is indicated by a node tag (?) @: This tag is indicating the property of the node *: This tag is indicating any value (value of node or node).: This tag is Indicates the current node ..: This tag is indicating that the current node uses an example: // human 'This XPath statement indicates that all Human nodes // human / boy' this xpath statement under root node space indicates that it is obtained. All BOY nodes under the human node under the root node // human / boy [@ name = 'A Yong'] 'This XPath statement indicates that the value of all Name properties under the human node under the root node is "A Yong "BOY Node // Human / Boy [@Name] 'This XPath statement indicates that all BOY nodes // human / * [@ name]' this xpath statement under the human node under the root node Indicates that all nodes with Name properties under the human node under the root node

Learning Steps: Data Binding of XML Data and Web Controls: How to Bind the Upper Data to DropDownList Control After Using the XMLDocument class How to deal with the second-level interaction of the menu: How to deal with "provinces" and "city" two menu subsequent data Display. Note that when the value of the "province" drop-down menu changes, "City" drop-down menu data is also changed. How to get the area code and postal code of a city: use the XPath statement to query a city data and finally get the area code and post coding

Demo example: http://192.168.1.61/ASPNET/webtest/index.aspx

XML Data File Download: http://192.168.1.61/ASPNET/webtest/COUNTRYCODE.XML (please use right click "Save As" Download)

转载请注明原文地址:https://www.9cbs.com/read-64339.html

New Post(0)