views:

125

answers:

2

how to download the aspx page as a html page. i have used download code that downloads me the aspx page as html. but i when open the file saved in my desktop it is showing the format as <@page directive.....> and oly<% %> <% %> <% %> <% %> <% %> <% %>

this tags are coming. how should i resolve this problem and get the page download / saved in propr html format.

pls help... very urgent

i have a aspx page which is giving me some customer details in web browser. i need to save the web page as a html in desktop.

A: 

The code between <% %> is server-side code and cannot be downloaded directly. The web server simply won't pass it--so what you want is not even possible.

When viewing in a browser, you can "View Source" and save this as HTML, but again, any server-side code will not be available.

Russ
+1  A: 

Are you viweing this web page from your local machine? It sounds like you're downloading the ASPX page (which would be allowed if you were just specifying a directory path), instead of rendering it.

Check your IIS settings and make sure that:

  • the starting point for your web app is configured
  • that script execution is enabled
  • that it is the correct ASP.NET version.

Then navigate to the webpage (localhost:theportnumber), right click, and download the rendered html.

seraphym