Using server.mapth for file location

Results 1 to 2 of 2

Thread: Using server.mapth for file location

  1. #1
    Join Date
    Dec 1969

    Default Using server.mapth for file location

    Hi All<BR>I have a page rediret happening when my session variable runs out. In my new site how ever I have various directory depths, but using the 1 file which is included in the others for the redirection.<BR><BR>How do I got about using server.mappath to find the path of the file from any directory depth within my site?<BR><BR>Ive been trying but get errors.<BR>const LoginPage = Server.MapPath("/Administration/default1.asp")

  2. #2
    Join Date
    Dec 1969

    Default HUH???

    You should *NEVER* use Server.MapPath to get the name of a page that you want to Response.Redirect to!<BR><BR>Response.Redirect does *NOT* take a physical path...only a virtual one.<BR><BR>And if the file is at the "top level" of your site, then you just do:<BR> Response.Redirect "/default1.asp"<BR><BR>nothing more.<BR><BR>You *could* do:<BR> Response.Redirect ""<BR>as well.<BR><BR>But *never* Server.MapPath!<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts