ASP. net2.0 has been systematically studied recently. Watch the msdn WebCASE video tutorial "ASP. net2.0 Quick Start" (Thank you, Mr Su Peng :)). This section describes the use of the xmldatasource control. Create a page, drag and drop an xmldatasource control, bind an online XML file as the data source, drag a formview control, edit the template itemtemplate, drag two labels, and set data binding, use the XPath expression to obtain the "title" and "Description" fields in the XML file. The language used in the tutorial is VB, And I used C #. I drew a picture in IDE, completed the compilation, and "When !", What's wrong? The output window shows "there is no 'xpath 'name in the context '". This is strange. Why is it wrong when we press it step by step? So the demo of the tutorialCode(VB) is added to the solution, compiled, and passed once. There is no problem at all. I am wondering, except for the different background languages, these two projects have the same settings. I can't help but search for them online. I read the error message, XPath, and XPath again and again... In lower case, I suddenly thought that VB is case-insensitive. What if it is C? Should XPath be written as XPath? Whether it makes sense or not, try again. The result is still masked and the compilation passes smoothly.
This is an episode in my study, but it has been tossing me for a long time. Write down this article as a mark of growth.