Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8530441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:14:54+00:00 2026-06-11T09:14:54+00:00

I am binding the star rating jQuery in a repeater control. The rating value

  • 0

I am binding the star rating jQuery in a repeater control.

The rating value is taken from the database.The issue which I face is,the repeater control displays only the last rating value from database.

I tried by the method given here Turn a number into star rating display using jQuery and CSS

jQuery added to the example:

$(document).ready(function () {
            $('#chk').click(function () {         
                $('input[type=hidden]').each(function () {
                    var hiddenValue = $(this).val();                  
                    document.getElementById('span1').html = hiddenValue;
                    $("#span1").text(hiddenValue);
                });

My design code is:

<asp:repeater id="RepDetails" runat="server">
<HeaderTemplate>
   </HeaderTemplate>
<ItemTemplate>   
Rating:<td align="left">
  <span class="stars" id="span1"></span>
</td>
<asp:HiddenField ID="HiddenField1" runat="server" Value='<%#Eval("Rating") %>' />
 <a id="chk">Click</a>
</td>  
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:repeater>

Code file

protected void Page_Load(object sender, EventArgs e)
{        
        partnerid = "1";
        productid = "2";
        DataSet ds = ServiceObj.GetComments(partnerid, productid);
        RepDetails.DataSource = ds.Tables[0];
        RepDetails.DataBind();
}

Any suggestions to bind the rating for each value from database?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:14:55+00:00Added an answer on June 11, 2026 at 9:14 am

    At first look you have one error which can be responsible for your problem:

    $("#span1").text(hiddenValue);
    

    If I’m right your jQuery selector will find DOM element with ID, which means that only one element should be found. Thus you have propably only last #span1 found in jQuery. Try change this to another selector for example:

    $(".aClass").text(hiddenValue);
    $(this).find('input[type="hidden"]').text(hiddenValue);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Current Situation: Direct Binding I have an NSTableView which displays the data that comes
Im binding data from database to webgrid, i want to keep an actionlink edit
I have a project which is under source control via Star Team in VS
1) Binding to The following populates a READ ONLY WinFrms grid: Dim query =
When Binding a GridView to a DataTable, How can we Change the value displayed
I am binding the value to report viewer dynamically. While click on the button
I'm working on Expression Blend and I'm currently designing a custom control which has
Which binding should I choose to enable sessions following is my service interface: [ServiceContract(SessionMode=SessionMode.Required)]
Hello I have an asp.net application where i am getting value from twitter and
Which binding should I use to make my WCF application communicate through UDP instead

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.