<a href="/Document/Download?id=<%= ViewData.Eval("documentRead.DocumentID") %>">下载该文档</a>

这句代码是在页面中被点击以后返回DocumentController类的Download()方法,在Download方法里面有以下语句:

            int documentid = Request.QueryString["id"].ToInteger();
            //此处加上下载数的逻辑
            document.UpdateDownloadCount(documentid);  //DownCount字段加一
            //此处开始下载
            string ss ="/"+ GetURL(documentid);
            Response.Redirect(ss);

在下载之前先对Document的表中的DownCount的字段加1,然后取出url后对它进行适当的处理,最后

用Response.Redirect(ss)来获得资源。。。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-11-14
  • 2022-01-15
  • 2022-02-18
  • 2022-02-21
猜你喜欢
  • 2022-12-23
  • 2022-02-02
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
相关资源
相似解决方案