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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

760 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

18 Experts available now in Live!

Get 1:1 Help Now