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 8008229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:04:22+00:00 2026-06-04T18:04:22+00:00

I’m trying to use the rating control in the ajax toolkit. I’m currently setting

  • 0

I’m trying to use the rating control in the ajax toolkit. I’m currently setting the currentrating to whatever the average rating is for that item. However, that means no one can pick that value. For example – if the current rating is 3, then no one will be able to select 3.

I found this post on stackoverflow asking the same question:
Ajax control toolkit Rating Control- Override RatingBehavior.js

But i haven’t had any luck getting that to work. I’m guessing because it’s an old post, about 3 years old, and things have changed with the rating control since then.

So – anyone know how i can display the current rating and still allow that value to be submitted?

Thanks

  • 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-04T18:04:23+00:00Added an answer on June 4, 2026 at 6:04 pm

    I hope you’ve found a solution to this issue, just in case you haven’t here it is:

    1. Add a hidden field to the page/user control where the rating control is, eg.

    2. Add the following script block to the page/user control:

      var ratingID = “”; //client ID for the rating control
      var ratingClientID = “”; //unique ID for the rating control
      var hfAverageRatingID = “”; //hidden field ID

    3. Add the code below to an external js file, then reference it in your ScriptManagerProxy or ToolScriptManager control:

      var rating;

      Sys.Application.add_load(function () {
      $(“.ratingStars a”).click(function () {
      var avgValue = $(“#” + hfAverageRatingID).val();
      var ratingValue = $find(“RatingCtrl_RatingExtender”).get_Rating();
      //we only want to run custom code when the average rating == the chosen rating
      if (ratingValue == avgValue) {
      if ((ratingValue < 0) || (ratingValue > rating._maxRatingValue)) {
      return;
      }
      rating._update();
      Sys.Extended.UI.RatingBehavior.callBaseMethod(rating, ‘set_ClientState’, [rating._ratingValue]);
      rating.raisePropertyChanged(‘Rating’);
      rating.raiseRated(rating._currentRating);
      rating._waitingMode(true);
      var args = rating._currentRating + “;” + rating._tag;
      var id = rating._callbackID; // unique id — ctl00$cphMainContainer$bjxRatings1$pageRating
      if (rating._autoPostBack) {
      __doPostBack(id, args);
      }
      else {
      WebForm_DoCallback(id, args, rating._receiveServerData, rating, rating._onError, true)
      }
      }
      });
      $create(Sys.Extended.UI.RatingBehavior, { “AutoPostBack”: true, “CallbackID”: ratingClientID, “ClientStateFieldID”: “RatingCtrl_RatingExtender_ClientState”, “id”: “RatingCtrl_RatingExtender” }, null, null, $get(ratingID));
      rating = $find(“RatingCtrl_RatingExtender”);
      });

    Something interesting to note is that the link you posted has outdated code, with the newer ajaxToolkit library you can’t reference it from ‘AjaxControlToolkit’ in javascript. Instead you must use ‘Sys.Extended.UI’ in the js file.

    Best of luck,
    Shawn

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.