Active Server Pages (ASP) MapPath There are occasions when you do not want to put a literal drive mapping to an ASP page. You can get the path relative to the current web site (ASP execution directory) by using the MapPath method of the Server object. For example:
– returns web root directory: C:\inetpub\wwwroot <% = Server.MapPath("/scripts")%> – returns: C:\inetpub\wwwroot\scripts The URLEncode method will convert quotes, spaces, other non-alphanumeric characters for URL use. For example:
– returns: Dave%27s+%231Sample The HTMLEncode method will convert quotes, spaces, other non-alphanumeric characters for HTML use. For example:
– returns: <%Session.Abandon%> The default for ScriptTimeout is 90 seconds. If you have a script that has to execute over a modem on a slow phone line, for example, you may want to increase the value. For example:
– increases timeout to 180 seconds (3 min). |