Associating a rating with an id

2 posts, 0 answers
  1. Dan Ehrmann
    Dan Ehrmann avatar
    152 posts
    Member since:
    Jul 2004

    Posted 29 Dec 2009 Link to this post

    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.

  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 30 Dec 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top