0
我有一些xml文件,其中包含用於在我的頁面中填充下拉列表的源數據。這些下拉菜單根據其他放棄的選定項目重新填充。我收到了服務器錯誤在xml文件中讀取時發生服務器錯誤
找不到路徑 X的一部分:\ ASP.Net \ CommodDisplay \數據文件\ dataXML.xml」。
即使這是一個有效的路徑。
這裏是使用調用它的代碼;
Dim doc As New XmlDocument()
'Load XML from the file into XmlDocument object
doc.Load(HttpContext.Current.Server.MapPath("~/DataFiles/dataXML.xml"))
Dim root As XmlNode = doc.DocumentElement
'Select all nodes with the tag Book
Dim nodeList As XmlNodeList = root.SelectNodes("futures")
For Each node As XmlNode In nodeList
ddlMainsub1.Items.Add(node.SelectSingleNode("product").InnerText)
Next
我也試過它只是使用Server.MapPath和我得到相同的錯誤。這些文件位於網絡驅動器中。這很重要嗎?