如何在asp.net中进行离线缓存浏览? [英] How do I get offline cached browsing working in asp.net?

查看:80
本文介绍了如何在asp.net中进行离线缓存浏览?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图让我的网站通过在asp.net中使用缓存清单文件来脱机运行,但无法让它工作。我正在使用带有asp.net和javascript的Visual Studio 2010.



首先,我在主项目目录中创建了一个文件cache.manifest,如下所示:



I have been trying to get my site so that it will run offline by using a cache manifest file in asp.net, but cannot get it to work. I am using Visual Studio 2010 with asp.net and javascript.

First, I created a file "cache.manifest" in the main project directory which looks like this:

CACHE MANIFEST

CACHE:
http://mysite.com/dvams/Images/1.jpg
http://mysite.com/dvams/Images/2.jpg
http://mysite.com/dvams/Images/3.jpg
http://mysite.com/dvams/Images/4.jpg
http://mysite.com/dvams/Images/5.jpg
http://mysite.com/dvams/Images/6.jpg

NETWORK:
*

FALLBACK:
/online offline.html





接下来我添加了以下对web.config文件的system.webServer部分的引用。





Next I added the following reference to the "system.webServer" section of my web.config file.

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





我看到的所有代码示例和说明都说要添加属性manifest 到.aspx页面中的html元素,但是当我这样做时,它似乎没有识别清单元素。



当我将清单元素添加到像这样的标题:

< html xmlns =http://www.w3.org/1999/xhtmlmanifest =cache.manifest>



我收到错误:



警告89验证(XHTML 1.0 Transitional):属性'manifest'不是元素'html'的有效属性。



我已经搜索了高低,以解释如何使这个工作,但我找不到任何解释这个问题以及如何解决它。一些帮助将不胜感激。



All the code samples and instructions I've seen then say to add the attribute "manifest" to the html element in the .aspx page, however when I do this it does not seem to recognise the manifest element.

When I add the manifest element to the header like so:
<html xmlns="http://www.w3.org/1999/xhtml" manifest="cache.manifest">

I get the error:

Warning 89 Validation (XHTML 1.0 Transitional): Attribute 'manifest' is not a valid attribute of element 'html'.

I have searched high and low for an explanation of how to get this working, but I cannot find anything explaining this problem and how to fix it. Some help would be greatly appreciated.

推荐答案

检查这些:

1. attribute-ng-app-is-not-valid-attribute.html [ ^ ]

2. creating-html5-offline -web-applications-with-asp-net [ ^ ]
Check these out:
1. attribute-ng-app-is-not-valid-attribute.html[^]
2. creating-html5-offline-web-applications-with-asp-net[^]


谢谢!这是一个HTML版本问题,详见第一个链接。我没有意识到HTML 5.0是全新的,尚未完全支持。我的开发环境需要一个补丁才能使其兼容。
Thanks! It was a HTML version issue, as detailed in your first link. I didn't realise HTML 5.0 was brand new and not fully supported yet. My development environment needs a patch to make it compatible.


这篇关于如何在asp.net中进行离线缓存浏览?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆