阿贾克斯评级星

时间:2011-07-27 01:47:18

标签: asp.net ajax

这是一件非常简单的事情。 我没有在网格视图中看到我的Ajax Rating Star

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
    <Columns>
    <asp:BoundField  HeaderText="PurchasedPID" DataField="PurchasedPID"/>
     <asp:BoundField  HeaderText="DatetimePurchased" DataField="datetime purchased"/>
    <asp:BoundField  HeaderText="MMBName" DataField="MMBName"/>
    <asp:TemplateField HeaderText="Rating">
    <ItemTemplate>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

                   <cc1:Rating ID="Rating1" runat="server" CurrentRating="1" MaxRating="5"
                      StarCssClass="ratingStar"
                                WaitingStarCssClass="savedRatingStar"
                                FilledStarCssClass="filledRatingStar"
                                EmptyStarCssClass="emptyRatingStar" >
                     </cc1:Rating>


        </ContentTemplate>
        </asp:UpdatePanel>


    </ItemTemplate>
    </asp:TemplateField>

    </Columns>
    </asp:GridView>
   </asp:Panel>

的site.css  `

.ratingStar {
                font-size: 0pt;
                width: 13px;
                height: 12px;
                margin: 0px;
                padding: 0px;
                cursor: pointer;
                display: block;
                background-repeat: no-repeat;
            }

            .filledRatingStar {
                background-image: url(Images/FilledStar.png);

            }

            .emptyRatingStar {
                background-image: url(Images/EmptyStar.png);
            }

            .savedRatingStar {
                background-image: url(Images/SavedStar.png);
            }


     `

1 个答案:

答案 0 :(得分:2)

您需要引用与样式表位置相关的图像。如果根目录中有一个文件夹:Images / EmptyStar.png,你的Css在styles / site.css中 - 那么你需要引用它:

.filledRatingStar {
                background-image: url(../Images/FilledStar.png);

            }

            .emptyRatingStar {
                background-image: url(../Images/EmptyStar.png);
            }

            .savedRatingStar {
                background-image: url(../Images/SavedStar.png);
            }