.NET Framework - MapPath not working with ASP.NET MVC

Asked By shapper on 22-Jul-08 02:16 AM
Hello,

On a class method I have the following:

HttpContext.Current.Request.MapPath("Data/Assets.xml");

I call this function from a View named "Document/New" which controller
is DocumentController and I end up with:

Could not find a part of the path 'C:\Documents and Settings\Me\My
Documents\Visual Studio\MyApp\Document\Data\Assets.xml'.

Where the correct path should be:

'C:\Documents and Settings\Me\My Documents\Visual Studio\MyApp\Data
\Assets.xml'.

How to solve this?

Thanks,

Miguel




Ignacio Machin ( .NET/ C# MVP ) replied on 22-Jul-08 02:17 AM
Hi,

This is the wrnog NG, you should post this in the ASPNET NG or in the
MVC forum