Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading XML file
Message
From
20/09/2004 13:43:52
 
 
To
20/09/2004 11:11:36
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00944026
Message ID:
00944093
Views:
21
Jerry,

>I have a ASP.Net webform that reads an xml file on Page_Load(). This xml file exists in the same directory on the web server as the .ASPX file. However, my .ASPX can't find the xml file unless I specify the full path the xml file.
>Is there a way to find the xml file without using the fullpath?

I don't know if you can specify the XML filename without a path, but if you need to dynamically find the path you could perhaps use a method of the Request object to find at least the physical path of the virtual dir. To demonstrate, you could put this into the Page_load of a Webform:
Response.Write("Request.PhysicalApplicationPath(): " & _
Request.PhysicalApplicationPath() & "<br>")
Based on this, you should be able to use Request.PhysicalApplicationPath(), which returns a string, as part of your path\filename parameter.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Reply
Map
View

Click here to load this message in the networking platform