If it's an ASP.NET page, you might be able to play with Response.AddHeader -
though I'm not sure if IIS will overwrite the value. If IIS does overwrite
the value OR you want to control the last-modified for an non-aspx.net file,
you're likely stuck with having to write an ISAPI filter. With IIS 7, you'll
be able to write those in .NET (yay).
If it's an ASP.NET page, you might be able to play with Response.AddHeader -
though I'm not sure if IIS will overwrite the value. If IIS does overwrite
the value OR you want to control the last-modified for an non-aspx.net file,
you're likely stuck with having to write an ISAPI filter. With IIS 7, you'll
be able to write those in .NET (yay).
Thank you! I have been a windows developer for many moons now. I have
tabled in web programming, but.. Well, it is a very different world
Question: now do I confirm the code is working? Here is what I have
and I am not seeing anything different in the generated HTML:
FileInfo fi = new FileInfo(this.Request.PhysicalPath);
this.Response.AddHeader("If-Modified-Since",
fi.LastWriteTimeUtc.ToString("r"));
Get a tool like fiddler (www.fiddlertool.com, free) set it up to proxy your
browser (IE should automatically detect it running) and hit the page. Then
look at the response headers before and after, hopefully something changed.
Get a tool like fiddler (www.fiddlertool.com, free) set it up to proxy your
browser (IE should automatically detect it running) and hit the page. Then
look at the response headers before and after, hopefully something changed.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.