Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

AJAX Rating Control in ListView Control

Avatar of obautista
obautista asked on
C#ASP.NETAJAX
2 Comments1 Solution1164 ViewsLast Modified:
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>
ASKER CERTIFIED SOLUTION
Avatar of buraksarica
buraksaricaFlag of Turkey image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers