asp.net Web表单中的星级评分

时间:2017-10-29 14:03:28

标签: css asp.net rating

我正在尝试通过悬停来开发星级评分功能。我有三张图片1.fullstar,2empty star 3半星。我的代码不起作用。 我有带css类和评级代码的aspx页面。我使用了ajaxtoolkit作为评级。缺少逻辑的地方需要确定。

<%@ Page Title="Contact" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Contact.aspx.cs" Inherits="MH.Contact" %>
 <%@ Register Assembly ="AjaxControlToolkit" namespace="AjaxControlToolkit" TagPrefix="cc1"  %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
       <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.css">
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js"></script>
       <style >
        .starrating{

            width:50px;
            height:50px;
            cursor:pointer;
            background-repeat: no-repeat;
            display:block;
        }
 .FilledStars { background-image: url(Images/Star/icnStar.png); }
 .WaitingStars { background-image: url(Images/Star/icnStarHalf.png);  }
 .EmptyStars { background-image:url(Images/Star/icnStarMT.png) ;
 }
</style>

</head>
<body>
    <form runat="server">

        <div>
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <cc1:Rating ID="Rating1" runat="server"

                    StarCssClass="starrating"
                    FilledStarCssClass="FilledStars"
                    EmptyStarCssClass="EmptyStars"                     
                     WaitingStarCssClass="WaitingStars" 
                    CurrentRating="0"
                    MaxRating="5"
                    >
                </cc1:Rating>
            </ContentTemplate>
        </asp:UpdatePanel>
            </div>
        </form>
</body>
</html>
</asp:Content>

0 个答案:

没有答案