ASP。NET MVC完全离线网站

时间:2022-02-04 03:32:50

I made an ASP.NET MVC application which allows user to create dynamic websites. I need to add feature which will allow to download from server off-line version of choosen website as static html files with menu, hyperlinks, images, documents etc. It should work similar to applications such as Teleport Pro, but I have to choose from Admin Panel which content should be export.

我做了一个ASP。NET MVC应用程序,允许用户创建动态网站。我需要添加一个功能,可以从服务器离线版本的choosen网站下载,作为静态html文件,包含菜单、超链接、图片、文档等。它应该与Teleport Pro等应用程序类似,但我必须从管理面板中选择应该导出的内容。

Client wants to burn static website on CD, save on pendrive.

客户要在CD上烧录静态网站,保存在pendrive上。

Do you have any ideas how to begin? Please help.

你知道怎么开始吗?请帮助。

2 个解决方案

#1


2  

I currently have implemented that in a current project...

我目前已经在一个项目中实现了这一点……

User is able to change anything in the frontend and at the end he can publish and download the offline files... the site subscribe users and show all prizes, winners and more information about that campaign.

用户可以更改前端中的任何内容,最后可以发布和下载离线文件……该网站订阅用户,并显示所有奖品,获胜者和更多有关该活动的信息。

All was done in ASP.NET MVC3 under .NET4 and hosted in AppHarbor.

这一切都是在ASP中完成的。NET MVC3在。net4下,托管在AppHarbor。

It's composed at several applications but for what you want, you develop the Backend and the Frontend, and to generate the static files, simple use the Frontend to grab the full HTML

它由几个应用程序组成,但是对于您想要的,您可以开发后端和前端,并且要生成静态文件,只需使用前端获取完整的HTML

As an example, I can show what 2 users did...

例如,我可以展示两个用户做了什么……

Callme.dk did http://callme.julekal.info and Sony Nordic did http://sony.julekal.info

Callme。dk做了http://callme.julekal.info,索尼北欧做了http://sony.julekal.info

plus, you can simply point custom domains to it as well like http://sonynordicxmas.net/

另外,您可以简单地将自定义域指向它,比如http://sonynordicxmas.net/。

To publish and generate all files:

发布和生成所有文件:

ASP。NET MVC完全离线网站

one part of the editing:

剪辑的一部分:

ASP。NET MVC完全离线网站

So I give the users, offline access (through the .zip file), online access (through the frontend application) and the ability of using custom domains...

所以我给用户,离线访问(通过。zip文件),在线访问(通过前端应用程序)和使用自定义域的能力……

#2


0  

I think the only way this might be possible is if you go to every single page and then use your browser to "Save" the web page script and all.

我认为唯一可能实现这一目标的方法是,访问每个页面,然后使用浏览器“保存”web页面脚本等等。

However this causes several issues;

然而,这引起了几个问题;

  1. You never quite get everything and you need to massage the HTML produced, dowload all the images etc to get the page to look right
  2. 你永远不会得到所有的东西,你需要按摩HTML制作,下载所有的图片等来让页面看起来正确。
  3. Each html file now has an associated folder with the same name and each time you do this you will get another html file with a folder. You can combine all the folders into a single one but that leads me to item 3.
  4. 每个html文件现在都有一个名称相同的关联文件夹,每次您这样做时,您将得到另一个带有文件夹的html文件。您可以将所有文件夹合并为一个文件夹,但这导致了第3项。
  5. You will need to edit each html file to clear up any pathing issues if you want to share a single source folder.
  6. 如果您想要共享一个源文件夹,您将需要编辑每个html文件以清除任何路径问题。
  7. Data is no longer dynamic!
  8. 数据不再是动态的!
  9. You need to, if you want to link all the pages to each other, edit every single html file and resolver the anchor tags.
  10. 如果希望将所有页面链接到彼此,则需要编辑每个html文件并解析锚标记。

This is too much work and I think it actually breaks the true requirement.

这工作量太大了,我认为这实际上违反了真正的要求。

Don't do it! :)

不要这样做!:)

#1


2  

I currently have implemented that in a current project...

我目前已经在一个项目中实现了这一点……

User is able to change anything in the frontend and at the end he can publish and download the offline files... the site subscribe users and show all prizes, winners and more information about that campaign.

用户可以更改前端中的任何内容,最后可以发布和下载离线文件……该网站订阅用户,并显示所有奖品,获胜者和更多有关该活动的信息。

All was done in ASP.NET MVC3 under .NET4 and hosted in AppHarbor.

这一切都是在ASP中完成的。NET MVC3在。net4下,托管在AppHarbor。

It's composed at several applications but for what you want, you develop the Backend and the Frontend, and to generate the static files, simple use the Frontend to grab the full HTML

它由几个应用程序组成,但是对于您想要的,您可以开发后端和前端,并且要生成静态文件,只需使用前端获取完整的HTML

As an example, I can show what 2 users did...

例如,我可以展示两个用户做了什么……

Callme.dk did http://callme.julekal.info and Sony Nordic did http://sony.julekal.info

Callme。dk做了http://callme.julekal.info,索尼北欧做了http://sony.julekal.info

plus, you can simply point custom domains to it as well like http://sonynordicxmas.net/

另外,您可以简单地将自定义域指向它,比如http://sonynordicxmas.net/。

To publish and generate all files:

发布和生成所有文件:

ASP。NET MVC完全离线网站

one part of the editing:

剪辑的一部分:

ASP。NET MVC完全离线网站

So I give the users, offline access (through the .zip file), online access (through the frontend application) and the ability of using custom domains...

所以我给用户,离线访问(通过。zip文件),在线访问(通过前端应用程序)和使用自定义域的能力……

#2


0  

I think the only way this might be possible is if you go to every single page and then use your browser to "Save" the web page script and all.

我认为唯一可能实现这一目标的方法是,访问每个页面,然后使用浏览器“保存”web页面脚本等等。

However this causes several issues;

然而,这引起了几个问题;

  1. You never quite get everything and you need to massage the HTML produced, dowload all the images etc to get the page to look right
  2. 你永远不会得到所有的东西,你需要按摩HTML制作,下载所有的图片等来让页面看起来正确。
  3. Each html file now has an associated folder with the same name and each time you do this you will get another html file with a folder. You can combine all the folders into a single one but that leads me to item 3.
  4. 每个html文件现在都有一个名称相同的关联文件夹,每次您这样做时,您将得到另一个带有文件夹的html文件。您可以将所有文件夹合并为一个文件夹,但这导致了第3项。
  5. You will need to edit each html file to clear up any pathing issues if you want to share a single source folder.
  6. 如果您想要共享一个源文件夹,您将需要编辑每个html文件以清除任何路径问题。
  7. Data is no longer dynamic!
  8. 数据不再是动态的!
  9. You need to, if you want to link all the pages to each other, edit every single html file and resolver the anchor tags.
  10. 如果希望将所有页面链接到彼此,则需要编辑每个html文件并解析锚标记。

This is too much work and I think it actually breaks the true requirement.

这工作量太大了,我认为这实际上违反了真正的要求。

Don't do it! :)

不要这样做!:)