Html 如何将aspx页面转换为html页面?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3112301/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to convert aspx page into html page?
提问by TinTin
I have designed my web page in asp.net its in aspx page. i need to covert it into html page .Because my server not support .aspx page help me to solve this issue
我在asp.net 中设计了我的网页,它在aspx 页面中。我需要把它转换成 html 页面。因为我的服务器不支持 .aspx 页面帮我解决这个问题
采纳答案by amelvin
Open it on your local machine in a browser, view the source (View | Source in IE, View | Page Source in Firefox etc ), then save that page source as pagename.html.
在本地机器上的浏览器中打开它,查看源代码(在 IE 中查看 | 源代码,在 Firefox 中查看 | 页面源代码等),然后将该页面源代码保存为 pagename.html。
Obviously you'll lose any asp.net page methods etc.
显然,您将丢失任何 asp.net 页面方法等。
回答by Quentin
- Remove all the server side code
- Rename the file
- 删除所有服务器端代码
- 重命名文件
or
或者
- Open in web browser
- Pick Save As
- 在网络浏览器中打开
- 选择另存为
回答by Abhishek Motiwale
That is not a good idea, if I understand you right.
如果我理解正确的话,这不是一个好主意。
HTML files are static - the only processing allowed is on the client machine, via javascript.
HTML 文件是静态的 - 唯一允许的处理是在客户端机器上,通过 javascript。
ASPX files are dynamic, there is processing on the server each time the page is loaded or interacted with by the user, and this generates HTML which is passed to the client browser.
ASPX 文件是动态的,每次页面被用户加载或交互时都会在服务器上进行处理,这会生成传递给客户端浏览器的 HTML。
If you convert your ASPX to HTML you will lose all the dynamic elements of the page. Try it: Load your ASPX page in the browser and right click. Select "View Page Source (or whatever your browser calls it) and save that to you local HDD. You can load it, and it will look like your page, but nothing will actually work.
如果您将 ASPX 转换为 HTML,您将丢失页面的所有动态元素。试试看:在浏览器中加载您的 ASPX 页面并右键单击。选择“查看页面源代码(或浏览器调用的任何内容)”并将其保存到本地硬盘。您可以加载它,它看起来像您的页面,但实际上没有任何效果。
回答by Emiliano Poggi
Powershell way:
Powershell方式:
$cred = Get-Credential # if required $aspxpage = Invoke-WebRequest -Uri $uri -Credential $cred $aspxpage.Content > "test.html"
It may be useful on more complex use cases to process many pages.
在更复杂的用例中处理多个页面可能很有用。
回答by wowo_999
put it on a server that supports asp, and then view the source and copy to a static html file
放到支持asp的服务器上,然后查看源码复制到静态html文件