views:

30

answers:

1

i'm building an asp.net site with master pages. When visitors views a page, I'd like to show the date and time the child page was last updated. I'd also like to do this all at the master page level so no code for getting this information needs to be added to each child page.

Is this possible? what would be the best way to do it?

Thank you in advanced!

+1  A: 

Page.Request.PhysicalPath will give you the physical path of the page.

And the FileInfo class can be used to get its last update date.

There are caveats if you are redirecting using Server.Execute or Server.Transfer, in which case there are several alternative ways of doing this, including the one described in the Remarks section of the MSDN documentation for HttpRequest.PhysicalPath.

Joe
This is precisely the information i needed. Thank you very much!
Andres