<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RateArticle.aspx.cs" Inherits="Rating_RateArticle" %>
<%@ Register TagPrefix="APNSoft" Namespace="APNSoft.WebControls" Assembly="APNSoftControls" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    
    <script type="text/javascript">

        //Show rating result
        function RefreshRating(ComponentID, Parameter){
            
            //Get the number of votes & average rating
            if(Parameter!=''){
                Votes = Parameter.split('_')[0];
                AverageRating = Parameter.split('_')[1];
            }
            
            //Refresh the Rating Control
            rt.SetValue(ComponentID, AverageRating);
            
            //Refresh the average rating & number of votes
            document.getElementById("average").innerHTML = AverageRating; 
            document.getElementById("votes").innerHTML = Votes; 
        };

    </script>
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    
        <div style="border:solid 1px #eaeaea;width:500px;padding:12px;background-color:#F7F7F7;">
            <b>User controls</b>

            <br/><br/>
            User controls are encapsulations of sections of pages which are registered and used as controls in ASP.NET. User controls are created as ASCX markup files. These files usually contain static (X)HTML markup, as well as markup defining server-side Web controls. These are the locations where the developer can place the required static and dynamic content. A user control is compiled when its containing page is requested and is stored in memory for subsequent requests. User controls have their own events which are handled during the life of ASP.NET requests. An event bubbling mechanism provides the ability to pass an event fired by a user control up to its containing page. Unlike an ASP.NET page, a user control cannot be requested independently; one of its containing pages is requested instead.

            <br/><br/>
            <div style="display:inline-block; background-color:White; padding:12px; border:solid 1px #eaeaea; margin-left:300px;font-size:11px;">
                Please rate the quality of this article:
                <br/><br/>
                <span style="position:relative;top:-4px;left:0px;color:Red;"><b>Poor</b></span>
                <APNSoft:APNSoftRating id="myRating" runat="server" 
                    SkinFolder = "~/Rating/Skins/Stars/" 
                    AutoCallBackOnSegmentClick = "True"
                    ClientSideAfterCallBack = "RefreshRating('$ComponentID$','$Parameter$');"
                />
                <span style="position:relative;top:-4px;left:4px;color:Green;"><b>Excellent</b></span>
                <br/><br/>
                Average rating: <b><span id="average"><%=GetAverageRating()%></span></b>&nbsp;&nbsp;&nbsp;(<span id="votes"><%=Votes%></span> votes)
            </div>
        
        </div>

    



    </div>
    </form>
</body>
</html>