Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Please explain what "Empty path has no directory" means with Server.MapPath

Reply
Thread Tools

Please explain what "Empty path has no directory" means with Server.MapPath

 
 
Alan Silver
Guest
Posts: n/a
 
      06-28-2005
Hello,

I have the following line of code in a script...

litMsg.Text = Server.MapPath("/");

where litMsg is an ASP.Net Literal control. When I try and run this
page, I get the error ...

System.ArgumentException: Empty path has no directory.

Anyone any idea what this means? I have used Server.MapPath many times
before without error, I'm not sure why it suddenly stopped working here.

I'm sure I'm missing something blindingly obvious and would be grateful
if anyone could point it out!! TIA.

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
 
Alan Silver
Guest
Posts: n/a
 
      06-28-2005
IN case it's of any use to anyone, I found out that the problem was
caused by me having the following two lines in Page_Load...

HttpContext myContext = HttpContext.Current;
myContext.RewritePath("/");

I'm not actually sure *why* I had those lines there, they must have been
from something I was doing before. As soon as I removed them, the
Server.MapPath worked fine.

If anyone has an explanation, I would like to hear it

>Hello,
>
>I have the following line of code in a script...
>
>litMsg.Text = Server.MapPath("/");
>
>where litMsg is an ASP.Net Literal control. When I try and run this
>page, I get the error ...
>
>System.ArgumentException: Empty path has no directory.
>
>Anyone any idea what this means? I have used Server.MapPath many times
>before without error, I'm not sure why it suddenly stopped working here.
>
>I'm sure I'm missing something blindingly obvious and would be grateful
>if anyone could point it out!! TIA.
>


--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please explain this "Why's" example please Kaye Ng Ruby 8 06-08-2010 09:13 AM
Please explain what this expression means Lilith C++ 2 05-23-2007 05:39 AM
Please explain why B/W image has blue edges Jerry Digital Photography 1 02-09-2006 05:10 PM
Can anyone explain what this means to me... Wookie ASP .Net 2 11-13-2005 03:20 PM
explain what this means windandwaves Javascript 4 08-29-2005 08:10 AM



Advertisments