ComponentOne Extender Controls for ASP.NET Web Forms
Wijmo Control Toolkit Extender Controls / C1RatingExtender / Using C1Rating Extender Events
In This Topic
    Using C1Rating Extender Events
    In This Topic

    Create a new ASP.NET Web application.

    1. Add a standard Panel control to the main content of your page and set the ID to ratingDiv.
    2. Click the Panel smart tag and choose Add Extender from the Panel Tasks menu.
    3. In the Extender Wizard, select the C1RatingExtender from the list and click OK. A C1RatingExtender control is added to the page and the TargetControlID is set to ratingDiv.
    4. Select View | Properties in the Visual Studio menu.
    5. Click the drop-down list at the top of the Properties window and select ratingDiv_C1RatingExtender.
    6. Set the C1RatingExtender.OnClientHover event to starHover.
    7. Set the C1RatingExtender.OnClientRated event to starRated.
    8. Add the following script to the first set of <asp:Content> tags.

    <script type="text/javascript">

        function starHover(e, args) {

            $("#hover").html(args.value);

        }

        function starRated(e, args) {

            $("#rated").html(args.value);

        }

          </script>

    1. Add the following markup to the second set of <asp:Content> tags, after the closing </div> tag.

    <div>hover value is:<label id="hover"></label></div>

    <div>rated value is:<label id="rated"></label></div>

    1. Press F5 to run your application. Click on the stars to use the rating control. The events should fire and the page should resemble the following image.