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

  • Home
  • SEARCH
  • 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 3661726
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:20:14+00:00 2026-05-19T01:20:14+00:00

I am using a jQuery rating plugin inside a asp:listview with in a asp:update

  • 0

I am using a jQuery rating plugin inside a asp:listview with in a asp:update panel. Below is the function which is being called on click of rating stars.

function DisplayRatings() {            
            $('DIV.ratingBar').each(function() {
                var id = $(this).attr('id');
                var count = $(this).attr('rel');
                $('#' + id).raty({
                    showCancel: false,
                    readOnly: false,
                    showHalf: true,
                    start: count,
                    onClick: function(score) {                    
                      // I have to pass the score and ID to server side                    
                    }
                });
            });
        }

Now I have to pass the ‘score’ and ‘ID’ to server side and call a method which rebinds the listview and updates the rating on the screen without screen refresh.
Please suggest how to go about this.( I can’t use ajax toolkit rating as it doesn’t support half star rating)

  • 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-05-19T01:20:14+00:00Added an answer on May 19, 2026 at 1:20 am

    To pass data to the server, just store it in hidden form fields (in the UpdatePanel):

    <asp:HiddenField id="score" runat="server" name="Score" ClientIDMode="Static" />
    <asp:HiddenField id="id" runat="server" name="Score" ClientIDMode="Static" />
    

    If you had a lot of data to pass back and forth, probably it would make sense just to use one hidden field and use serialization/deserialization to store it all there. Then in your onClick function, set the values of those fields, and initiate an async postback:

    $('#score').val(score);
    $('#id').val(id);
    __doPostBack('UpdatePanelID', '') 
    

    This will cause an async update of your UpdatePanel, same as if a bound submit control was clicked by the user.

    Note that if the jQuery control itself is in the UpdatePanel, you will have to reconfigure it after the async postback, since the effect is just as if the page had been reloaded as far as it is concerned. However, any javascript code which you may have run in $(document).ready() will not run after an async postback, since the whole page wasn’t actually reloaded.

    Ideally, keep the rating control outside the update panel, since you probably don’t want it to change as a result of an event it initiated. If this isn’t possible for some reason, or you just need a dynamic way to configure it the first time it is visible, then add a hook from the end of a page refresh:

    // Page startup script - this adds a hook after an update panel is refreshed
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(onRefresh);
    
    function onRefresh(sender, args) {
        // You can try to check which panel was updated
        var panelsUpdated  = args.get_panelsUpdated();
        var panelsCreated = args.get_panelsCreated();
        // but usually it's easier to just track the state of your jquery stuff
        if (my_jquery_thing_is_visible &&
            my_indicator_that_it_has_already_been_configured===false) {
            configureJqueryThing();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this plugin: http://www.fyneworks.com/jquery/star-rating/ Is it possible to put a click function inside
I'm using the jQuery Star Rating plugin on an ASP.NET MVC site, and I
Im using this plugin: http://www.fyneworks.com/jquery/star-rating It includes a star.gif (which actually contains the star
Using jQuery, how do you bind a click event to a table cell (below,
I'm using the jquery star rating plugin by fyneworks. The problem is that about
Using jQuery I want to be able to click an element which will also
I'm using jQuery Stars Rating plugin ( http://www.fyneworks.com/jquery/star-rating/ ). I'm having difficulty displaying an
Using the jQuery Star Rating plugin everything works well until I select a star
I'm using Chris Richards' Star Rating jQuery Plugin from Github alongwith the jQuery Template
Using jQuery, how would you find elements which have a particular style (eg: float:

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.