问题描述
hi All
我在项目中使用了评分控件,并将该评分控件与datalist绑定在一起.我使用storeprocedure和linq技术绑定了数据列表,我使用了一个名为rating table的表和一个保存avg评分,ratedto的视图,用户类型.我将评分显示为
hi All
i have used a rating control in my project.and bind that rating control in with datalist.i had bind the datalist using a storeprocedure and linq technique i have used a table named as rating table and a view which holds the avg rating,ratedto,usertype .and i am displaying the rating as
<ajaxToolkit:Rating runat="server" ID="Rating1" MaxRating="5"
CssClass="ratingStar" StarCssClass="ratingItem" WaitingStarCssClass="Saved" CurrentRating= '<%#Eval("rating") %>'
OnChanged ="rating_Changed" FilledStarCssClass="Filled" EmptyStarCssClass="Empty" AutoPostBack="True"
ReadOnly ="true" ></ajaxToolkit:Rating>
在数据列表中,我正在显示所有已评级和未评级的用户类型.它向我显示了评级控件可以将空值转换为int32类型的错误.因此,我将如何显示平均评级.我想通过5星评级来显示评级如果没有得到评分,请向我显示空星.
我将如何处理此空值并将其转换为未评级的int或零.
如果有人知道解决方案,那么请解决此问题.
在此先感谢所有人.
here in the datalist i am displaying all the usertype both rated and unrated.it shows me error that rating control can convert null value to int32 type.SO how will i display the avg rating.i want to display the rating through the 5 star rating and if those are not rated showed me with empty star.
how will i handle this null value and convert to int or zero for which are not rated.
if anybody knows the solution then please solve this.
Thanks in Advance To all.
推荐答案
这篇关于评级控制中的空值问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!