views:

105

answers:

1

I need to get the name of the script being executed on the master page to update the Last Write time.

I'm using this:

System.IO.File.GetLastWriteTime(Server.MapPath(Request.FilePath))

which works for the default.aspx, but if its within a View I am unable to workout what the physical path to the file is to get the LastWriteTime.

Is there a solution to this? Surely I'm missing something incredibly easy here.

Thanks!

A: 

From what I know about System.Web.Routing, the routing happens in IIS, making it impossible to get the true physical path of your View. You can always try to use

this.Request.PhysicalPath

to get the physical path but it will return something like :

C:\Projects\MySolution\MyProject\ViewFolder\ViewAction
Peter