0

I'm using asp.net 3.0.

I have Page A doing a Server.Transfer to Page B.

On both page A and Page B I'm want to be able to use System.IO.File.GetLastWriteTime(MapPath(Page.Request.Path.ToString())) in order to display the last modified date at the top of each file.

This works well on page A, but when I use Server.Transfer to page B, Page.Request.Path still refers to Page A as opposed to Page B.

Is there any way around this without changing from Server.Transfer to Response.Redirect (Server.Transfer is important for my other sections of code on both pages)

1 Answers1

1

Try this instead:

System.IO.File.GetLastWriteTime(MapPath(Page.Request.AppRelativeCurrentExecutionFilePath))
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • Absolutely brilliant. Thanks a million, I was scratching my head on this for quite a while. –  May 05 '09 at 18:38