Star rating in Listview

Posted by Anu_dgr8 under ASP.NET AJAX on 7/6/2011 | Points: 10 | Views : 2863 | Status : [Member] | Replies : 2
I HAVE A SURVEY FORM ,IN WHICH THERE ARE A COUPLE OF QUESTIONS TO BE ASKED TO AN EMPLOYEE..AND EACH QUESTION IS FOLLOWED BY A STAR RATING..THE LIST OF QUESTIONS ARE IN A DATABASE TABLE.AND I M FETCHIN THOSE QUESTIONS FROM THAT TABLE..NOW I HAVE ISSUE IN FORM DESIGN ..I TRIED USING A LISTVIEW HAVING A LABEL AND AN AJAX STAR RATING CONTROL IN ITEMTEMPLATE..BUT ITS GIVING ERROR THAT 2 RATING CONTROLS CANT HAVE SAME ID..CAN ANY1 HELP ME OUT??

OR IS THERE ANY OTHER EASIER WAY OF DOING IT DYNAMICALLY?

THANKS IN ADVANCE:)

Thanks and Regards,
Hoosha Boosha



Responses

Posted by: Anu_dgr8 on: 7/7/2011 [Member] Starter | Points: 25

Up
0
Down
Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'ratingbehaviour' can't be added to the application.

<asp:ListView ID="lstViewTest" runat="server" >

<LayoutTemplate>
<table width="100%">
<tr runat="server" id="groupPlaceHolder">
</tr>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr runat="server" id="TblRow">
<td runat="server" id="itemPlaceHolder">
</td>
</tr>
</GroupTemplate>
<ItemTemplate>
<tr id="Tr1" runat="server">
<td>
<asp:LinkButton ID="lnkCampaign" runat="server" ToolTip="" Text='<%#Eval("campaign_name") %>'></asp:LinkButton>
<ajaxtoolkit:Rating ID=id BehaviorID=ratingbehaviour runat=server
CurrentRating="0"
MaxRating="5" StarCssClass="ratingStar"
WaitingStarCssClass=savedRatingStar FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar"></ajaxtoolkit:Rating>

</td>
</tr>
</ItemTemplate>
</asp:ListView>


My exact problem is this.

Thanks and Regards,
Hoosha Boosha

Anu_dgr8, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 7/7/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Can you use a simple Radio Button to perform the same operation as you are doing using ajax rating toolkit. Toolkit is not always better way to do the work, as it comes with the cost in terms of performance of the page and these types of issue as well.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Anu_dgr8, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response