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
785 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
text align center the options is an html select 4 38
CSS Font Arial Narrow 1 26
Max-width on individual images in grid 4 51
Error on Add method 1 37
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
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…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

930 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now