看板 C_Sharp 關於我們 聯絡資訊
※ 引述《maxjoiny (封塵)》之銘言: : protected void LinkButtonD_Command(object sender, CommandEventArgs e) : { : SqlDataSource _SqlDataSource = new : SqlDataSource(ConfigurationManager.ConnectionStrings["XBRLServiceConnectionString"].ConnectionString, : ""); : _SqlDataSource.UpdateCommand = "Update record set number = number+1 : where name = 'download'"; : _SqlDataSource.Update(); : Response.Redirect("./instance/" + e.CommandArgument.ToString()); : } : 這是後端的CS檔案的CODE : 我的問題是 Response.Redirect 這個只能導入頁面 有函式可以用來開新分頁嗎 EX BLANK : 因為他是動態產生的檔案 (DB有才有) 所以想問問有沒有方法解決 : 還有就是要如何點CLICK 下載檔案 利用後端的CODE? 上述看起來可以在Response.Redirect 改成用Literal輸出script去做window.open 如果是動態產生網頁 可以考慮有一個Page的Header替換成檔案下載的方式 這個button就單純用script去open該Page就行了 -- 被遺忘的瞇瞇: http://sheauren.blogspot.com/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.44.248.81
maxjoiny:3q 01/23 00:41