public void createstaticpage (int bookId)
{
Query to ID
var book = this. DbSession.BooksDal.LoadEntities (c = c.id==bookid). FirstOrDefault ();
Open HTML template file
var html = HttpContext.Current.Request.MapPath ("/template/bookdetailtemlate.html");
var content = File.readalltext (HTML);
Replace the value of an HTML template file
Content = content. Replace ("$title", book. Title). Replace ("$author", book. Author)
. Replace ("$untiPrice", book. Unitprice.tostring ("0.00")). Replace ("$isbn", book. ISBN)
. Replace ("$toc", book. TOC). Replace ("$content", book. ContentDescription);
String fulldir = "/htmlpage/" + book. Publishdate.year + "/" + book. Publishdate.month +
"/" + book. Publishdate.day + "/";
Create folder, File
Directory.CreateDirectory (Path.getdirectoryname (HttpContext.Current.Request.MapPath (Fulldir)));
File.writealltext (HttpContext.Current.Request.MapPath (fulldir) + BookId + ". html"
, content, Encoding.UTF8);
}
Replace HTML table contents