"Multiple controls with the same ID 'id' were found" Error when I try to use rating cotrol in ASP.NET page
I am stuck on this error:
"Multiple controls with the same ID 'id' were found"
I got this error when i tried to add rating control in ASP.NET web page. Here is the code for rating control:
<myrating:Rating ID="LikeRating1" runat="server"
开发者_StackOverflow中文版 CurrentRating="3"
MaxRating="5"
StarCssClass="ratingStar"
WaitingStarCssClass="savedRatingStar"
FilledStarCssClass="filledRatingStar"
EmptyStarCssClass="emptyRatingStar"
OnChanged="LikeRating_Changed"
style="float: left;">
</myrating:Rating>
At start of the page i have added this line also:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="myrating" %>
Why I am getting this error than?? I don't think that there are any IDs conflict in this file because i get this error when i added this rating control. Please help, thanks.
Are you sure it's the rating control that does this? In the source (website source, in the browser), have you searched for id="id" alone? Are you adding controls dynamically, without setting their ID?
There is another possibility in case if it gives the same error after removing 1st detected control, You must be overriding the base.SomeMethod... and it 's being called when its already overrided . eg FrameworkInitilize (){ // base.FrameworkInitilize() } and again in some_event[page_Load]{FrameworkInitilize ()}
精彩评论