Hi all, it has been awhile since I posted. Here is something new, and kinda cool.
Problem: Need to create a tracking program to track what user downloads as in documents from the Sitefinity Images & Document Library.
Goal: Avoid rewriting Sitefinity Download List control. It is a nice control, I like it the way it is, and don't have time to modify it.
Solution:
I determine the best solution to this problem was to create a control that I can drop beneath the Download List Control. I decided to use Jquery with the Telerik RadXmlHttpPanel control.
1. I created a new user custom control containing the RadXmlHttpPanel.
2. I use the Sitefinity JsFileLink control to load the jquery library, and jquery script for the download tracker.
3. Use document.ready to wire up javascript to call the RadXmlHttpPanel. I assign the Sitefinity Download List control an ID of DownloadLink. I use an expression to locate the id like: [id$=DownloadLink]. This allow me to find all the download anchor tags and wire them up to the click event.
4. Once I wired up the click events, I created a call to a javascript function that pass the Document Name to the RadXMLHttpPanel.
5. In the code behind for the RadXMLHttpPanel, I retrieve the UserID, IP Address, Document Name and other items. I use the data collected to make a linq to sql insert statement to the tracking table.
Results:
This new control is useable on all my Download Document pages. It does not mess with the original Download List. This took me about an hour to figure out and write. It works great.