Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
799 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 900 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 600 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Suggested Courses

927 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