Multiple controls with the same ID 'frmRfq' were found. Trace requires that controls have unique IDs.

Multiple controls with the same ID 'frmRfq' were found. Trace requires that controls have unique IDs.

Post by -glenn » Fri, 22 Feb 2002 10:33:27



OK, I've searched the archives for this one with no luck. My Web Form (using
code behind) has only one control (or anything, for that matter) named
frmRfq - and it's on the server-side <form> tag (in the id attribute). When
I build then browse to the page (obviously, with Trace="true") the error in
the subject line is returned.

Has anyone seen this or have ideas on what the problem is?

Funny thing is that I have been working on this page for hours and have been
able to turn trace on and off, browse to the page, make many changes, then
all of a sudden this message.

Thanks for any ideas.

-glenn-

 
 
 

Multiple controls with the same ID 'frmRfq' were found. Trace requires that controls have unique IDs.

Post by Ken Cox [Microsoft MVP » Fri, 22 Feb 2002 11:20:46


Did something hiccup in the codebehind that  VS.NET forgot to rewrite one of
the statements it inserts?

What does a text search of frmRfq turn up?

Show us the code?

Ken


Quote:> OK, I've searched the archives for this one with no luck. My Web Form
(using
> code behind) has only one control (or anything, for that matter) named
> frmRfq - and it's on the server-side <form> tag (in the id attribute).
When
> I build then browse to the page (obviously, with Trace="true") the error
in
> the subject line is returned.

> Has anyone seen this or have ideas on what the problem is?

> Funny thing is that I have been working on this page for hours and have
been
> able to turn trace on and off, browse to the page, make many changes, then
> all of a sudden this message.

> Thanks for any ideas.

> -glenn-


 
 
 

Multiple controls with the same ID 'frmRfq' were found. Trace requires that controls have unique IDs.

Post by Ken Cox [Microsoft MVP » Fri, 22 Feb 2002 11:56:14


Hmmm... is the name in one of the header or footer include files? I don't
have them and can build the page when I take out their references.

Ken


> Q1. No idea.

> Q2. A search of frmRfq in the aspx and the aspx.cs reveals that name only
on
> the <form> tag and as the class name.

> Q3. The two files are attached.

> Thanks for any ideas.

> -glenn-



> > Did something hiccup in the codebehind that  VS.NET forgot to rewrite
one
> of
> > the statements it inserts?

> > What does a text search of frmRfq turn up?

> > Show us the code?

> > Ken



> > > OK, I've searched the archives for this one with no luck. My Web Form
> > (using
> > > code behind) has only one control (or anything, for that matter) named
> > > frmRfq - and it's on the server-side <form> tag (in the id attribute).
> > When
> > > I build then browse to the page (obviously, with Trace="true") the
error
> > in
> > > the subject line is returned.

> > > Has anyone seen this or have ideas on what the problem is?

> > > Funny thing is that I have been working on this page for hours and
have
> > been
> > > able to turn trace on and off, browse to the page, make many changes,
> then
> > > all of a sudden this message.

> > > Thanks for any ideas.

> > > -glenn-

 
 
 

Multiple controls with the same ID 'frmRfq' were found. Trace requires that controls have unique IDs.

Post by Michael Graham ( » Fri, 22 Feb 2002 23:07:01


I also notice that you are inheriting a class that has the name frmRfq:  
Inherits="PrancinWeb.am.frmRfq.  It's possible
that this is where the duplication is occurring.  Do you have the same
problem if you change the form id to "frmRfq1"?
Try doing a find/replace, and making sure that you change the Inherits line
back to normal.  Let us know!  Good luck!


This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

Multiple controls with the same ID 'frmRfq' were found. Trace requires that controls have unique IDs.

Post by -glenn » Fri, 22 Feb 2002 23:16:58


Thanks, Michael - it was the Inherits. So much for auto-generated code!

The strange thing is that with the Inherits the page would mostly work -
just once in a while the multiple controls error would occur. Oh well.

-glenn-



> I also notice that you are inheriting a class that has the name frmRfq:
> Inherits="PrancinWeb.am.frmRfq.  It's possible
> that this is where the duplication is occurring.  Do you have the same
> problem if you change the form id to "frmRfq1"?
> Try doing a find/replace, and making sure that you change the Inherits
line
> back to normal.  Let us know!  Good luck!


> This posting is provided "AS IS" with no warranties, and confers no

rights.
 
 
 

Multiple controls with the same ID 'frmRfq' were found. Trace requires that controls have unique IDs.

Post by -glenn » Fri, 22 Feb 2002 23:31:18


Wait, wait, wait. It's early for me. Of course, the Inherits is there
because that is how the code behind class name is communicated to the page.
So the Inherits must be there. frmRfq is the name of the form which then
becomes the name of the code behind class. If I change the form name to Rfq
and do a build then the Inherits line changes to Rfq and the code behind
class name changes to Rfq. I thought this was how things were supposed to
work.

But. If I keep the form name as frmRfq and then change the Inherits value to
be PrancinWeb.am.Rfq, the class name to be that, and the following
auto-generated line in the InitializeComponent method:

    this.ID = "Rfq";

Everything builds (the class and/or form name does not magically change) and
I seem to be able to run the page without the multiple controls error.

So I guess the question becomes: Why is the IDE changing the class name when
I change the form name?

-glenn-


> Thanks, Michael - it was the Inherits. So much for auto-generated code!

> The strange thing is that with the Inherits the page would mostly work -
> just once in a while the multiple controls error would occur. Oh well.

> -glenn-



> > I also notice that you are inheriting a class that has the name frmRfq:
> > Inherits="PrancinWeb.am.frmRfq.  It's possible
> > that this is where the duplication is occurring.  Do you have the same
> > problem if you change the form id to "frmRfq1"?
> > Try doing a find/replace, and making sure that you change the Inherits
> line
> > back to normal.  Let us know!  Good luck!


> > This posting is provided "AS IS" with no warranties, and confers no
> rights.

 
 
 

Multiple controls with the same ID 'frmRfq' were found. Trace requires that controls have unique IDs.

Post by Michael Graham ( » Sat, 23 Feb 2002 00:39:50


Hey Glenn,

I shouldn't pipe in so quick!  You're right, the class will change as well
as the autogenerated
"this.ID".  They all need to be the same, which is why the IDE changes
them, but they seemed
to be the same in your sample.  I honestly don't know why it works now, and
didn't work then.
Perhaps just making the change, and then the change back allowed the IDE to
sync everything up
properly.  

If this happens again, or if you know of a step by step scenerio to
reproduce the behavior, please
let us know.  Thanks!


This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
 

1. Multiple controls with the same ID 'WebForm1' were found. Trace requires that controls have unique IDs.

I'm getting this error also.  I renamed my form, just like he did.  I have searched for a reply to this post but found none.  Does anybody know how to make this error go away?

  This error comes up if when tracing is turned on.  The interesting thing is that it only occurs if you choose to change the name of your form tag ID.  For example, say you just created a new ASP.NET form with the following ID:

      <form id="WebForm2" method="post" runat="server">
  Now say you want to rename the form ID to be "MyWebForm"

      <form id="MyWebForm" method="post" runat="server">

  When you change the ID the VS.NET IDE automatically changes the Inherits attibute as follows:

      Inherits="MyNameSpace.MyWebForm"

  and the code-behind file is also updated by the IDE as such

      public class MyWebForm : System.Web.UI.Page
  Once this change is complete, if you turn on tracing on the page (i.e. Trace = "True")  you will get the following error:

      Multiple controls with the same ID 'MyWebForm' were found. Trace requires that controls have unique IDs.

  This is very easy to reproduce.  Does anyone know why this error occurs?

2. HP 5300 Won't Work

3. Composite Control Prob - Multiple controls with the same ID '_ctl0' were found

4. Importing constraints

5. Multiple controls with the same ID '_ctl0' were found. FindControl requires that controls have unique IDs.

6. vpn browse issue

7. Validation error: Unable to find control id referenced by the 'ControlToValidate' property

8. Atari computers stuff forsale

9. User Control Instances and how .NET Prefixes control collection's ID's

10. FindControl requires that controls have unique IDs

11. FindControl requires that controls have unique IDs.

12. FindControl requires that controls have unique IDs

13. The id 'ctrl1' is already used by another control