In ASP. NET 2.0CodeOr save it as a static file. ASP. NET provides the httprequest. saveas method to directly save requests as files. The following method is used to obtain the HTML code generated by ASP. NET in ASP. NET 2.0 and generate a static file.
C #
<xmp> &amp; Lt; % @ page Language = &quot;C #&quot; autoeventwireup = &quot;true&quot; % &amp; gt; &lt;br/&gt; &amp; lt ;! Doctype HTML public &quot;-// W3C // dtd xhtml 1.0 transitional // en&quot; &lt;br/&gt; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot; &amp; gt; &lt;br/&gt; &amp; lt; HTML xmlns = &quot;http://www.w3.org/1999/xhtml&quot; &amp; gt; &lt;br/&gt; &amp; lt; Head &amp; gt; &lt;br/&gt; &amp; lt; Title &amp; gt; get ASP. net generated HTML &amp; lt;/Title &amp; gt; &lt;br/&gt; &amp; lt;/Head &amp; gt; &lt;br/&gt; &amp; lt; Body &amp; gt; &lt;br/&gt; &amp; lt; Form ID = &quot;form1&quot; runat = &quot;server&quot; &amp; gt; &lt;br/&gt; &amp; lt; ASP: gridview id = &quot;gridview1&quot; runat = &quot;server&quot; font-size = &quot;12px&quot; backcolor = &quot;# ffffff&quot; &lt;br/&gt; gridlines = &quot;both&quot; cellpadding = &quot;4&quot; width = &quot;560&quot; &amp; gt; &lt;br/&gt; &amp; lt; headerstyle backcolor = &quot;# ededed&quot; Height = &quot;26px&quot;/&amp; gt; &lt;br/&gt; &amp; lt;/ASP: gridview &amp; gt; &lt;br/&gt; &amp; lt;/Form &amp; gt; &lt;br/&gt; &amp; lt;/Body &amp; gt; &lt;br/&gt; &amp; lt;/html &amp; gt; &lt;br/&gt; </xmp>
VB. NET
<xmp> &amp; Lt; % @ page Language = &quot;VB&quot; % &amp; gt; &lt;br/&gt; &amp; lt ;! Doctype HTML public &quot;-// W3C // dtd xhtml 1.0 transitional // en&quot; &lt;br/&gt; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot; &amp; gt; &lt;br/&gt; &amp; lt; HTML xmlns = &quot;http://www.w3.org/1999/xhtml&quot; &amp; gt; &lt;br/&gt; &amp; lt; Head &amp; gt; &lt;br/&gt; &amp; lt; Title &amp; gt; get ASP. net generated HTML &amp; lt;/Title &amp; gt; &lt;br/&gt; &amp; lt;/Head &amp; gt; &lt;br/&gt; &amp; lt; Body &amp; gt; &lt;br/&gt; &amp; lt; Form ID = &quot;form1&quot; runat = &quot;server&quot; &amp; gt; &lt;br/&gt; &amp; lt; ASP: gridview id = &quot;gridview1&quot; runat = &quot;server&quot; font-size = &quot;12px&quot; backcolor = &quot;# ffffff&quot; &lt;br/&gt; gridlines = &quot;both&quot; cellpadding = &quot;4&quot; width = &quot;560&quot; &amp; gt; &lt;br/&gt; &amp; lt; headerstyle backcolor = &quot;# ededed&quot; Height = &quot;26px&quot;/&amp; gt; &lt;br/&gt; &amp; lt;/ASP: gridview &amp; gt; &lt;br/&gt; &amp; lt;/Form &amp; gt; &lt;br/&gt; &amp; lt;/Body &amp; gt; &lt;br/&gt; &amp; lt;/html &amp; gt; &lt;br/&gt; </xmp>