简体   繁体   中英

Server.Transfer and Getlastwritetime

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)

尝试以下方法:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM