我在我的asp.net webforms項目中有一個html文件,人們可以在單擊按鈕時下載該文件。從代碼隱藏操作.html文件
我想生成一些<select>
列表並追加到HTML的某些部分基於一些數據庫值之前,該文件發送給用戶。這可能使用C#?我目前的下載功能:
public void DownloadOfflineAuditSheetEditor(object s, EventArgs e)
{
Response.AppendHeader("content-disposition", "attachment; filename=thefile.html");
Response.WriteFile(Server.MapPath("~/thefile.html"), true);
Response.End();
}
看看[HtmlAgilityPack](http://stackoverflow.com/questions/2422762/html-agility-pack) – StuartLC
@nonnb Thans提示,看起來不錯! – Johan