![]() |
|
|
Server.Mappath - Using the ASP Server Object's Mappath MethodWhen you need to connect to a database or a file from your webpage
you’ll need to know the exact file path to that particular datasource. <%= Server.MapPath("/database/mydatabase.mdb")%> This script outputs the following: Because the path parameters in the following example does not start with a slash character, it is mapped relative to it's current directory, in this case c:\inetpub\wwwroot\database. <%= Server.MapPath("mydatabase.mdb")%> This script outputs the following: So in a nutshell the MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.
Site developed by Michael Wall - Web Design Belfast N.Ireland. |
|