Gridview的模板列中怎么点击HyperLink或Linkbutton后打开文件,并且触发后台事件

Gridview的模板列中如何点击HyperLink或Linkbutton后打开文件,并且触发后台事件
我的gridview中有一列是模板列,在rowdatabound事件中动态添加数量不定的文件链接,文件类型不定,当点击其中任一链接后,弹出下载对话框,行为和HyperLink类似,同时要触发gridview的rowcommand事件,统计点击次数,行为和LinkButton类似,不知如何处理

------解决方案--------------------
彈出文件下載對話框,可調用此方法:
private void FileDownload(string FullFileName)
{
FileInfo DownloadFile = new FileInfo(FullFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.ContentType = "application/octet-stream ";
Response.AppendHeader( "Content-Disposition ", "attachment;filename= " + HttpUtility.UrlEncode(DownloadFile.FullName, System.Text.Encoding.UTF8));
Response.AppendHeader( "Content-Length ", DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();
}
------解决方案--------------------
关注 。。。。。。。。
------解决方案--------------------
在rowcommand事件中 先处理计数, 然后向前台写个脚本. window.open( "文件地址 ", "_new ", " ");