XHTML

A minimal XHTML document

14 January 2009

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  <title>title</title>
  <link rel="stylesheet" type="text/css" href="style.css"/>
  <script type="text/javascript" src="script.js"></script>
 </head>
 <body>

</body>
</html>

Tagged as:

Saving ASP.NET output to HTML

1 November 2007

Just adding this handy peice of code for future reference – I can think of many examples where it could be if use.

Dim SendRequest As WebRequest
Dim GetResponse As WebResponse
Dim Reader As StreamReader
Dim Html As String
Dim Writer As StreamWriter

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SendRequest = WebRequest.Create("http://www.asp.net/learn/videos/")
GetResponse = SendRequest.GetResponse()
Reader = New StreamReader(GetResponse.GetResponseStream)
Html = Reader.ReadToEnd
Writer = File.CreateText(Server.MapPath("temp.htm"))
Writer.WriteLine(Html)
Writer.Close()
Response.WriteFile(Server.MapPath("temp.htm"))
End Sub

Tagged as: ,