作者sheauren (Ray)
看板C_Sharp
标题Re: [问题] 开新分页&下载档案
时间Wed Jan 21 22:49:29 2009
※ 引述《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
1F:推 maxjoiny:3q 01/23 00:41