AJAX Rating Control in ListView Control

I am using the AJAX Rating Control inside a ListView control.  I am creating a Rating Control for X number of records in my datasource.  The Rating Control is being created as expected, but not behaving correctly.  It only works on the first ListView record created.  When I hover over the stars in the first record, they change colors as expected.  The first record also posts back when I click on any of the stars.  This functionality does not work for all other records created in my ListView.  I am using .Net Framework 4.0 with ClientIdMode set to static.  Therefore, every Rating Control created is being assigned the same ID.  I did this because in CodeBehind I need to know which Star value was clicked on a particular record (i.e. in the Rating_Changed method).  In the code snippet window I am showing the markup that gets created.  This markup is repeated for every record in my datasource (every Rating Control generates the same markup).  Does anyone have any idea how to get this to work?  

Rating Control Markup:
<asp:Rating ID="Rating" runat="server"
  MaxRating="5"
  CurrentRating="2"
  CssClass="ratingStar"
  StarCssClass="ratingItem"
  WaitingStarCssClass="Saved"
  FilledStarCssClass="Filled"
  EmptyStarCssClass="Empty" AutoPostBack="True" OnChanged="Rating_Changed"
  >
</asp:Rating>
<div id="Rating" class="ratingStar">
<input type="hidden" name="ctl00$Tab1ContentPlaceHolder$lvMovies$ctrl0$ctl05$Rating_RatingExtender_ClientState" id="Rating_RatingExtender_ClientState" value="2" />
<a href="javascript:void(0)" id="Rating_A" title="2" style="text-decoration:none">
<span id="Rating_Star_1" class="ratingItem Filled" style="float:left;">&nbsp;</span>
<span id="Rating_Star_2" class="ratingItem Filled" style="float:left;">&nbsp;</span>
<span id="Rating_Star_3" class="ratingItem Empty" style="float:left;">&nbsp;</span>
<span id="Rating_Star_4" class="ratingItem Empty" style="float:left;">&nbsp;</span>
<span id="Rating_Star_5" class="ratingItem Empty" style="float:left;">&nbsp;</span></a>
</div>

Open in new window

obautistaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

buraksaricaCommented:
Why do you set the clientIdMode static? It Doesn't help you determine which rating control was clicked. Instead of static, set it to predictable, and use ClientIDRowSuffix propert on ListView to name the controls wtih a data bound column. So you can find out which control was clicked on ratingChanged event.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
obautistaAuthor Commented:
Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.