Friday, May 1, 2009

Displaying last modified date of asp.net page.

Using System.IO Name space we can find out time when page was last modified. we can also display LastWriteTime,CreationTime etc. of asp.net page. here if the code to display LastAccssTime of asp.net page.

string filePath = Server.MapPath(Request.Path);
System.IO.FileInfo fInfo = new System.IO.FileInfo(filePath);
lblLastWriteTime.Text = fInfo.CreationTime.ToString();


Put this code in Page_Load event of your page.

Thanks.

No comments:

Post a Comment

Comments posted on ASP.Net Ajax Tutorials Blog are moderated and will be approved only if they are on-topic and not abusive. Please email me or my team for tech-support or blogging related questions. Avoid including website URLs in your comments - Thanks Author