开发者

Rating control not appearing

开发者 https://www.devze.com 2023-02-04 17:28 出处:网络
I am trying to use the ASP.NET ajax rating control on my ASP.NET website. I have followed the exact steps from the video tutorial to use this rating control.

I am trying to use the ASP.NET ajax rating control on my ASP.NET website. I have followed the exact steps from the video tutorial to use this rating control.

Here's my HTML code.

 <div id="Rating" style="float:right; width:400px">       
       <div class="demoheading">Rating demonstration
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <ContentTemplate>
       <div style="float:left;width:230px">
       How much do you like this profile?
       </div><br />
           <开发者_运维知识库;asp:Rating ID="LikeRating" runat="server" CurrentRating="3" MaxRating="5" 
           StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" FilledStarCssClass="filledRatingStar" 
           EmptyStarCssClass="emptyStarRating" 
               style="float:left" onchanged="LikeRating_Changed1" Height="40px" 
               Width="400px">
           </asp:Rating><br />
           <div style="clear:left;">
           <asp:Button ID="ButtonSubmit" runat="server" Text="Submit" />
               <asp:Label ID="LabelResponse" runat="server" Text="[No response provided yet]"></asp:Label>
           </div>
       </ContentTemplate>
     </asp:UpdatePanel>
     <br /><br />
       </div>     

       </div>

My rating control is not appearing in the designer. However, when I hover that blank space it should be, it shows me the rating number as in the figure below. I did check the path of the images and the css I used for the star rating. Is there still something I am missing?

Rating control not appearing


You do not have the proper path to your image or the images do not exist. The control is there, the styles that you declare for the different type of stars do not have the images.

Also, you are missing a semicolon here:

emptyStarCssClass="emptyStarRating" 
           style="float:left"

should be

emptyStarCssClass="emptyStarRating" 
           style="float: left;"

I would recommend inspecting the element to check what it shows the image path is.

I missed the in designer part. I have experienced some issues where designer does not quite understand the image paths and will flag the path as bad, but in actuality it is fine. Have you tested the page in debug mode?

0

精彩评论

暂无评论...
验证码 换一张
取 消