Solved

getting error - Multiple controls with the same ID 'Page1' were found. FindControl requires that controls have unique IDs.

Posted on 2009-05-09
3
787 Views
Last Modified: 2012-06-27
I want to do numeric paging along with NEXT, PREVIOUS, FIRST, LAST.

I am getting error - Multiple controls with the same ID 'Page1' were found. FindControl requires that controls have unique IDsat the following code lines:


 Private Sub UpdatePageCounter(ByVal pagerInnerTable As HtmlTable)
           
            Dim pageCounter As Label = DirectCast(pagerInnerTable.Rows(0).Cells(0).FindControl("lblPageCounter"), Label)
            pageCounter.Text = (((" " & PageCounterText & " ") + (m_theGrid.PageIndex + 1).ToString() & " ") + PageCounterTotalText & " ") + m_theGrid.PageCount.ToString() & "&nbsp"
        End Sub

 kindly suggest solution to remove the error.
0
Comment
Question by:dnabatra
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Badotz earned 300 total points
ID: 24343677
It isn't your CODE, it is the duplicate ID ATTRIBUTES in your HTML.
0
 
LVL 12

Assisted Solution

by:Chad Haney
Chad Haney earned 200 total points
ID: 24396031
Agree with Badotz.  You have multiple entities in your HTML code that have the ID="Page1".

ID's should only be used once.  If you are utilizing them for styling, change this to utilize classes.  Otherwise if you are looping items you will need to add it an iterator to make the different entities utilize different ID values.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 24623375
Grade "B"? Was I bad?
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
This video teaches users how to migrate an existing Wordpress website to a new domain.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question