I have a aspx that passes a "full path" of an XML file to a function which then opens a stream....
All works well on the production server, but on the development server "c:\windows\system32" is appended to the path instead of what server.mappath returns.
Any Ideas?
Here are the pertinent parts of the code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
XMLFilePath = Server.MapPath("includes/employees.xml").ToString
GetTreeData(XMLFilePath, viewstate("loggedInEmpID"))
End Sub
Public Function GetTreeData(ByVal XMLFilePath As String) As String
Dim xmlDoc As XmlDocument = New XmlDocument
Dim flstream As StreamReader = File.OpenText(XMLFilePath)
Dim xmlData As String = flstream.ReadToEnd
xmlDoc.LoadXml(xmlData)
flstream.Close()
All works well on the production server, but on the development server "c:\windows\system32" is appended to the path instead of what server.mappath returns.
Any Ideas?
Here are the pertinent parts of the code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
XMLFilePath = Server.MapPath("includes/employees.xml").ToString
GetTreeData(XMLFilePath, viewstate("loggedInEmpID"))
End Sub
Public Function GetTreeData(ByVal XMLFilePath As String) As String
Dim xmlDoc As XmlDocument = New XmlDocument
Dim flstream As StreamReader = File.OpenText(XMLFilePath)
Dim xmlData As String = flstream.ReadToEnd
xmlDoc.LoadXml(xmlData)
flstream.Close()