How to convert aspx page to html page?

I created my webpage in asp.net on an aspx page. I need to hide it in the html page. Since my server does not support the .aspx page, help me solve this problem.

+4
source share
5 answers

Open it on your local computer in a browser, browse the source (View | Source in IE, View | Source Source in Firefox, etc.), then save this page source as pagename.html.

Obviously, you will lose any asp.net page methods, etc.

+2
source
  • Remove all server side code
  • Rename file

or

  • Open in web browser
  • Select Save As
+2
source

This is not a good idea if I understand you correctly.

HTML files are static - only processing on the client machine through javascript is allowed.

ASPX files are dynamic, processing is performed on the server each time the page loads or interacts with the user, and this generates HTML, which is transmitted to the client browser.

If you convert ASPX to HTML, you will lose all dynamic page elements. Try it: load the ASPX page in the browser and right-click. Select "View Page Source" (or as its browser calls it) and save it to your local hard drive. You can download it and it will look like your page, but nothing will actually work.

+1
source

put it on a server supporting asp and then view the source code and copy it to a static html file

0
source

Powershell Mode:

  $ cred = Get-Credential # if required
 $ aspxpage = Invoke-WebRequest -Uri $ uri -Credential $ cred
 $ aspxpage.Content> "test.html"

It can be useful in more complex use cases for processing many pages.

0
source

Source: https://habr.com/ru/post/1313786/


All Articles