[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 804
  • Last Modified:

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

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
dnabatra
Asked:
dnabatra
  • 2
2 Solutions
 
BadotzCommented:
It isn't your CODE, it is the duplicate ID ATTRIBUTES in your HTML.
0
 
Chad HaneyChief Technology OfficerCommented:
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
 
BadotzCommented:
Grade "B"? Was I bad?
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now