471,330 Members | 1,053 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

MapPath not working with ASP.NET MVC

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
Jul 21 '08 #1
1 5181
On Jul 21, 1:09*pm, shapper <mdmo...@gmail.comwrote:
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
Hi,

This is the wrnog NG, you should post this in the ASPNET NG or in the
MVC forum
Jul 21 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by John Rebbeck | last post: by
5 posts views Thread by Ahmed El Lakani | last post: by
4 posts views Thread by Mark Horrocks | last post: by
10 posts views Thread by Kenneth P | last post: by
2 posts views Thread by Scott | last post: by
3 posts views Thread by Cozmo | last post: by
3 posts views Thread by rn5a | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.