It's very simple! Write a class to generate your custom html page and this class will use System.IO namespace and the methods you need to use steamwriter to generate the html tags.
for example,
StringBuilder HTML = new StringBuilder();
String NewLine = System.Environment.NewLine;
HTML.Append(
"<HTML>" + NewLine + "<head>" + NewLine);
HTML.Append("<title>" + TextBox2.Text.ToString() + "</title>" + NewLine + "</head>" + NewLine);
Hope it will helps. Try to google you will find so many examples like this.
Happy coding:)