Server.Transfer and Getlastwritetime

I am using asp.net 3.0.

I have a page doing Server.Transfer to page B.

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

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

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

0


source to share


1 answer


Try this instead:



System.IO.File.GetLastWriteTime(MapPath(Page.Request.AppRelativeCurrentExecutionFilePath))

      

+1


source







All Articles