Increasing the ViewsCout by HttpHandler

Posted by Community Admin on 03-Aug-2018 15:20

Increasing the ViewsCout by HttpHandler

All Replies

Posted by Community Admin on 11-Apr-2011 00:00

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

Posted by Community Admin on 11-Apr-2011 00:00

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


This thread is closed