【发布时间】:2011-03-03 13:04:51
【问题描述】:
我在 asp.net 中使用 .net 4.0。
我在 web 服务器上有一些 pdf 文件的文件夹,我在 gridview 中显示它的(文件名)名称然后我想做“当我在网格视图中单击项目然后它打开该 pdf 文件并生成带有文件的 url浏览器。”
我正在使用以下代码
GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).Parent.Parent;
LinkButton hk = (LinkButton)gvFiles.Rows[row.RowIndex].FindControl("lnkbtnTitleView");
string s = Server.MapPath("~/AppName/App_" + dtFiles.Rows[0]["ENewsLetterID"].ToString() + "_1.PDF");
hk.Attributes.Add("onclick","window.open('"+s+"')");
【问题讨论】:
标签: asp.net