0

Please give an example how I can integrate HTML code of offline caching in my ASP.Net application?

1
  • 1
    Please provide more information - where have your current research and practice attempts lead you thus far? Commented Apr 1, 2011 at 17:40

2 Answers 2

1

http://stephenwalther.com/blog/archive/2011/01/26/creating-html5-offline-web-applications-with-asp-net.aspx

Set up your cache manifest handler like this

using System.Web;

namespace JavaScriptReference {

    public class Manifest : IHttpHandler {

    public void ProcessRequest(HttpContext context) {
        context.Response.ContentType = "text/cache-manifest";
        context.Response.WriteFile(context.Server.MapPath("Manifest.txt"));
    }

    public bool IsReusable {
        get {
        return false;
        }
    }
    }
}

and then add your manifest handler in the html5 tag

<html xmlns="http://www.w3.org/1999/xhtml" manifest="Manifest.ashx">
Sign up to request clarification or add additional context in comments.

Comments

0

A better way to do this is to put the manifest content-type definition in your web.config under the system.webServer\staticContent tag.

  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".manifest" mimeType="text/cache-manifest" />
    </staticContent>
  </system.webServer>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.