This is a migrated thread and some comments may be shown as answers.

Associating a rating with an id

1 Answer 68 Views
Rating
This is a migrated thread and some comments may be shown as answers.
Dan Ehrmann
Top achievements
Rank 1
Dan Ehrmann asked on 29 Dec 2009, 02:33 PM
I posted a new thread last week but it doesn't appear to be listed, so I am posting it again.
 

I have the rating control implemented in a repeater that displays a list of documents (each of which has a unique document id), and I want to have one RadRating control associated with each document.  When a user clicks the rating control, I want to get the value of the rating gadget at the time it is clicked, and update the associated document with the rating. 

      

The problem is that I don’t know how to figure out the document id to get in order to update the data.  The service side event handler, OnRate returns the radrating object, but all this gives me is the value and no way to specify the document id.  Similarly, the client-side call, OnClientRated, you specify the name of the javascript function to call…with no parameters – it assumes the parameters are ‘sender’ and ‘args’.  

Please tell me how I can determine which id goes with which rating gadget in the repeater.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 30 Dec 2009, 08:44 AM
Hello Dan Ehrmann,
You can easily "tell" the RadRating control with which document you have associated it, by defining a custom attribute for the rating control. I have attached two pages - RadRatingCustomAttribute_OnClientRated.zip demonstrates how you can obtain the document id in the client handler for the rated event and RadRatingCustomAttribute_OnRate.zip demonstrates how you can obtain the document id in the server handler for the rate event.

Best wishes,
Tsvetie
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Rating
Asked by
Dan Ehrmann
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or