2011-03-21 68 views
1

我想要获得在ASP.NET 4中工作的Ajax Toolkit评级控制。我已经将它添加到页面中,并添加了注册语句,但它呈现为不可见(即:它与呈现在页面上显示:无ASP.NET工具包 - 评分

我有我的母版标准的ScriptManager,并在网页上显示一个标准的ScriptManagerProxy

我试图把评级一个UpdatePanel,但同样的事情发生。

这是我的代码:

<ajaxToolkit:Rating ID="ratRating" runat="server" MaxRating="5" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" OnChanged="rating_Changed" /> 

其中在下面的代码(注意它是隐藏与内联样式)

<div id="ctl00_ctl00_ctl00_cphBody_cphBody_cphBody_editRecipeForm_ratRating"> 
    <input type="hidden" value="3" id="ctl00_ctl00_ctl00_cphBody_cphBody_cphBody_editRecipeForm_ratRating_RatingExtender_ClientState" name="ctl00$ctl00$ctl00$cphBody$cphBody$cphBody$editRecipeForm$ratRating_RatingExtender_ClientState"> 
    <a style="text-decoration:none" title="3" id="ctl00_ctl00_ctl00_cphBody_cphBody_cphBody_editRecipeForm_ratRating_A" href="javascript:void(0)"> 
    <span style="float:left;" class="ratingStar filledRatingStar" id="ctl00_ctl00_ctl00_cphBody_cphBody_cphBody_editRecipeForm_ratRating_Star_1">&nbsp;</span> 
    <span style="float:left;" class="ratingStar filledRatingStar" id="ctl00_ctl00_ctl00_cphBody_cphBody_cphBody_editRecipeForm_ratRating_Star_2">&nbsp;</span> 
    <span style="float:left;" class="ratingStar filledRatingStar" id="ctl00_ctl00_ctl00_cphBody_cphBody_cphBody_editRecipeForm_ratRating_Star_3">&nbsp;</span> 
    <span style="float:left;" class="ratingStar emptyRatingStar" id="ctl00_ctl00_ctl00_cphBody_cphBody_cphBody_editRecipeForm_ratRating_Star_4">&nbsp;</span> 
    <span style="float:left;" class="ratingStar emptyRatingStar" id="ctl00_ctl00_ctl00_cphBody_cphBody_cphBody_editRecipeForm_ratRating_Star_5">&nbsp;</span> 
    </a> 
</div> 

我觉得很奇怪,有没有显示错误消息,并且我还没有明确地隐藏在任何地方控制的结果。

+1

你究竟在哪里看到它隐藏?它绑定到一个隐藏的控件(或者更确切地说是扩展),但我不确定它是什么意思的“隐藏”。 (即使在[演示页面]上也是如此)(http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Rating/Rating.aspx))。 – 2011-03-21 17:20:24

+0

你是对的,我似乎隐藏在演示中。这可能是造型问题。 – Echilon 2011-03-21 21:50:04

回答

2

它可能不是隐形的,而是评级星级的图像位置是错误的。

检查您的css类ratingStar,filledRatingStaremptyRatingStar