943,786 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2691
  • ASP.NET RSS
May 14th, 2009
0

server.mappath()

Expand Post »
hi,

what is the use of server.mappath().
what is the return value of this method.

Thanks in advance.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
ssreevidya.m is offline Offline
48 posts
since Jan 2009
May 14th, 2009
0

Re: server.mappath()

The MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.

returns string
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tonykmathew is offline Offline
6 posts
since May 2009
May 15th, 2009
0

Re: server.mappath()

Thank you for your answer.

But I couldn't get the concept relative or vortual path.Could you please describe it for me.

Thanks in advance.
Reputation Points: 10
Solved Threads: 0
Light Poster
ssreevidya.m is offline Offline
48 posts
since Jan 2009
May 15th, 2009
0

Re: server.mappath()

The MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.
Reputation Points: 1
Solved Threads: 2
Light Poster
shefeekj is offline Offline
37 posts
since Apr 2009
May 15th, 2009
0

Re: server.mappath()

It returns the physical path of the file or directory from the virtual path. As we setup a site in a remote server we don't have access to the server root path of our site in case of shared hosting. As our site is stored inside a particular folder of the server and by browser or by ftp access we can't move upward to wards the root of the server so it is not possible to get the physical path of any directory or file. Some of the objects like FileSystemObject requires physical path to handle various file and directory related commands. So here we can convert a virtual address of path to physical path by using Server MapPath method.
Reputation Points: 1
Solved Threads: 2
Light Poster
shefeekj is offline Offline
37 posts
since Apr 2009
May 17th, 2009
0

Re: server.mappath()

HI,
Why you do not try with below code:
ASP.NET Syntax (Toggle Plain Text)
  1. Response.Write(Server.MapPath("any folder name within the root"));

Hope now you can understand.
Reputation Points: 26
Solved Threads: 44
Posting Whiz in Training
mail2saion is offline Offline
247 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Update website control from usercontrol?
Next Thread in ASP.NET Forum Timeline: hosting error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC