Posts tagged with "XHTML"

A minimal XHTML document

Posted within Development on by Ryan Ball

<!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>

Saving ASP.NET output to HTML

Posted within Development on by Ryan Ball

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