NEW LISTINGS  HOT LISTINGS  TOP RATED  EDITOR PICK  ADD A LISTING  UPDATE A LISTING  GET RATED  UPGRADE A LISTING
  HOME     MY ACCOUNT     POWER SEARCH     REGISTER     MEMBER LIST     SUGGEST CATEGORY  

Average Visitor Rating: 0.00 (out of 5)
Number of ratings: 0 Votes

Visitor Rating

Work with If-Modified-Since and Last-Modified in ASP.Net.
3705 Work with If-Modified-Since and Last-Modified in ASP.Net. http://www.pstruh.cz/tips/detpg_net-last-modified/ Sometimes you will need to send static files over http using ASP.Net - for example if you want to control access to the file programmatically. Such tasks can be simply handled by Response.WriteFile(FileName) for plain html files, but there are two problems:
Response.ContentType is "text/html" by default. So if you want to write .gif images by ASPX, you have to set right Content-Type http header according to the file type (image/gif).
There is a good idea to handle at least Last-Modified and If-Modified-Since headers to reduce traffic and increase performance. Otherways, the file is sent each time.
I created a simple VB.Net support functions for this tasks.
1. GetContentType - returns content-type of a file from registry
2. DateFromHTTP - converts string date from http header (Fri, 09 Sep 2005 07:51:28 GMT format) to Date format
3. DateToHTTPDate - converts date to string format.
ASP.NET > Scripts and Controls > HTML Manipulation Oct 10, 2006 Antonin Foller

Write a Review   Add to My Favorite   Refer it to Friend   Report Broken Link  



Other links at ASP.NET > Scripts and Controls > HTML Manipulation
HTML to XML conversion component. Converts any HTML document to well-formed XML to allow for the programmatic extraction of information (i.e. HTML scraping).

File-to-file HTML to XML conversion.
Memory-to-memory HTML to XML conversion.
Ability to convert character encoding during conversion process.
Flexibility in controlling how HTML entities are handled.
Automatically convert HTML entities to corresponding 8-bit characters.
Ability to drop all text formatting tags from the output.
Ability to drop/undrop specific tags from the output.
Category:

Sometimes you will need to send static files over http using ASP.Net - for example if you want to control access to the file programmatically. Such tasks can be simply handled by Response.WriteFile(FileName) for plain html files, but there are two problems:
Response.ContentType is "text/html" by default. So if you want to write .gif images by ASPX, you have to set right Content-Type http header according to the file type (image/gif).
There is a good idea to handle at least Last-Modified and If-Modified-Since headers to reduce traffic and increase performance. Otherways, the file is sent each time.
I created a simple VB.Net support functions for this tasks.
1. GetContentType - returns content-type of a file from registry
2. DateFromHTTP - converts string date from http header (Fri, 09 Sep 2005 07:51:28 GMT format) to Date format
3. DateToHTTPDate - converts date to string format.
Category:




Main Category
178
2033
792
284
174
1802
1113
905
1157
7351
70
898
59
2186
172

Join Mailing List
Joining mailing list will entitle you to receive occasional emails informing you of news and updates to the site and any special offers that may be of interest to you.



Top 10
Directory Statistics

Links: 19152
Categories: 1275
Registered Users: 699
Mailing List Subscribers: 2042
Unique Outgoing Hits: 222478

Pagerank Statistics
PR 10
2 site(s)
PR 9
9 site(s)
PR 8
37 site(s)
PR 7
291 site(s)
PR 6
827 site(s)
PR 5
2015 site(s)

PHP News