More in this section

Forums / General Discussions / Increasing the ViewsCout by HttpHandler

Increasing the ViewsCout by HttpHandler

2 posts, 0 answered
  1. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    11 Apr 2011
    Link to this post
    Hello,
    I need to increment the viewcount from a download list and document list when clicking the link...
    I'm aware viewcount will not be handled till Q2 (I've read on PIT that it's scheduled for Q2), I've tried successfully in a mine custom control to increment the viewcount and it works (using)
    App.WorkWith().Document(guid).Do(doc =>
                {
                    doc.ViewsCount++;
     
                }).SaveChanges();

    but when working with the telerik download list how do I increment this?
    I've tried hineriting from  Telerik.Sitefinity.Modules.Libraries.Web.UI.Documents.DownloadListView but I got lost when overriding the methods.... I got the idea of using an httphandler and processing what stays below /Libraries but I got

    The WebResource.axd handler must be registered in the configuration to process this request.
     
    <!-- Web.Config Configuration File -->
     
    <configuration>
       <system.web>
           <httpHandlers>
               <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
           </httpHandlers>
       </system.web>
    </configuration>

    I've read the other post about the custom httphandler for a single page but in this case I wish to process all the items that referes to the path.... any suggestion?

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    11 Apr 2011
    Link to this post
    Hello Paolo,

    You have to override Telerik.Sitefinity.Modules.Libraries.Web.UI.Documents.MasterListView where we populate the control with data. There is a virtual method DataBindDocumentList where we bind the repeater  - "documentsRepeater"

    Then you should replace the default MasterListView of the DownloadList with your custom view.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

2 posts, 0 answered