Home All Groups Group Topic Archive Search About

Error: Multiple controls with the same ID

Author
11 Jul 2005 9:35 PM
Nathan Sokalski
When I view any page in my application a second time, I recieve the
following error:

[HttpException (0x80004005): Multiple controls with the same ID
'TitleBanner:_ctl0' were found. Trace requires that controls have unique
IDs.]
   System.Web.TraceContext.AddNewControl(String id, String parentId, String
type, Int32 viewStateSize) +313
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +201
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +263
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +263
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +263
   System.Web.UI.Page.ProcessRequestMain() +1608

If I close the browser and Visual Studio, and then reopen and rebuild the
application I can look at one page in the application one more time, but
then I recieve the error again. What can I do to prevent this error from
occurring? If there is any other information that might help figure out the
problem, I will be happy to give it to you. Here is the entire error page I
recieve:


Server Error in '/' Application.
--------------------------------------------------------------------------------

Multiple controls with the same ID 'TitleBanner:_ctl0' were found. Trace
requires that controls have unique IDs.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Multiple controls with the same
ID 'TitleBanner:_ctl0' were found. Trace requires that controls have unique
IDs.

Source Error:

      An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Multiple controls with the same ID
'TitleBanner:_ctl0' were found. Trace requires that controls have unique
IDs.]
   System.Web.TraceContext.AddNewControl(String id, String parentId, String
type, Int32 viewStateSize) +313
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +201
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +263
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +263
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState) +263
   System.Web.UI.Page.ProcessRequestMain() +1608



--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
      Request Details
      Session Id: 3nolkd55t1wljc452octxq55 Request Type: GET
      Time of Request: 7/11/2005 5:29:15 PM Status Code: 500
      Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
      Trace Information
      Category Message From First(s) From Last(s)
      aspx.page Begin Init
      aspx.page End Init 0.000021 0.000021
      aspx.page Begin PreRender 0.000235 0.000215
      aspx.page End PreRender 0.000260 0.000024
      Unhandled Execution Error
      Multiple controls with the same ID 'TitleBanner:_ctl0' were found.
Trace requires that controls have unique IDs.
        at System.Web.TraceContext.AddNewControl(String id, String parentId,
String type, Int32 viewStateSize)
        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState)
        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState)
        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState)
        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
calcViewState)
        at System.Web.UI.Page.ProcessRequestMain() 0.000584 0.000324
      Control Tree
      Control Id Type Render Size Bytes (including children) Viewstate Size
Bytes (excluding children)
      __PAGE ASP.index_aspx 0 0
          _ctl0 System.Web.UI.LiteralControl 0 0
          TitleBar System.Web.UI.HtmlControls.HtmlGenericControl 0 0
              _ctl1 System.Web.UI.LiteralControl 0 0
          _ctl2 System.Web.UI.ResourceBasedLiteralControl 0 0
          Form1 System.Web.UI.HtmlControls.HtmlForm 0 0
              _ctl3 System.Web.UI.LiteralControl 0 0
              TitleBanner ASP.Banner_ascx 0 0
                  TitleBanner:lblTitle System.Web.UI.WebControls.Label 0 0
                  TitleBanner:_ctl0 System.Web.UI.LiteralControl 0 0
      Cookies Collection
      Name Value Size
      ASP.NET_SessionId 3nolkd55t1wljc452octxq55 42
      Headers Collection
      Name Value
      Connection Keep-Alive
      Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/msword, */*
      Accept-Encoding gzip, deflate
      Accept-Language en-us
      Cookie ASP.NET_SessionId=3nolkd55t1wljc452octxq55
      Host localhost
      User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322)
      Server Variables
      Name Value
      ALL_HTTP HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:image/gif,
image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash,
application/msword, */* HTTP_ACCEPT_ENCODING:gzip, deflate
HTTP_ACCEPT_LANGUAGE:en-us
HTTP_COOKIE:ASP.NET_SessionId=3nolkd55t1wljc452octxq55 HTTP_HOST:localhost
HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322)
      ALL_RAW Connection: Keep-Alive Accept: image/gif, image/x-xbitmap,
image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword,
*/* Accept-Encoding: gzip, deflate Accept-Language: en-us Cookie:
ASP.NET_SessionId=3nolkd55t1wljc452octxq55 Host: localhost User-Agent:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
      APPL_MD_PATH /LM/W3SVC/1/ROOT
      APPL_PHYSICAL_PATH c:\inetpub\wwwroot\
      AUTH_TYPE
      AUTH_USER
      AUTH_PASSWORD
      LOGON_USER
      REMOTE_USER
      CERT_COOKIE
      CERT_FLAGS
      CERT_ISSUER
      CERT_KEYSIZE
      CERT_SECRETKEYSIZE
      CERT_SERIALNUMBER
      CERT_SERVER_ISSUER
      CERT_SERVER_SUBJECT
      CERT_SUBJECT
      CONTENT_LENGTH 0
      CONTENT_TYPE
      GATEWAY_INTERFACE CGI/1.1
      HTTPS off
      HTTPS_KEYSIZE
      HTTPS_SECRETKEYSIZE
      HTTPS_SERVER_ISSUER
      HTTPS_SERVER_SUBJECT
      INSTANCE_ID 1
      INSTANCE_META_PATH /LM/W3SVC/1
      LOCAL_ADDR 127.0.0.1
      PATH_INFO /index.aspx
      PATH_TRANSLATED c:\inetpub\wwwroot\index.aspx
      QUERY_STRING
      REMOTE_ADDR 127.0.0.1
      REMOTE_HOST 127.0.0.1
      REMOTE_PORT 1361
      REQUEST_METHOD GET
      SCRIPT_NAME /index.aspx
      SERVER_NAME localhost
      SERVER_PORT 80
      SERVER_PORT_SECURE 0
      SERVER_PROTOCOL HTTP/1.1
      SERVER_SOFTWARE Microsoft-IIS/5.1
      URL /index.aspx
      HTTP_CONNECTION Keep-Alive
      HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/msword, */*
      HTTP_ACCEPT_ENCODING gzip, deflate
      HTTP_ACCEPT_LANGUAGE en-us
      HTTP_COOKIE ASP.NET_SessionId=3nolkd55t1wljc452octxq55
      HTTP_HOST localhost
      HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 1.1.4322)



Thanks.
--
Nathan Sokalski
njsokal***@hotmail.com
http://www.nathansokalski.com/

Author
12 Jul 2005 2:29 AM
Dave Fancher
I had what appears to be the same problem about two weeks ago.  For some
reason, when I dynamically moved an HtmlTable from one container to another
(Page into PlaceHolder), the runtime dynamically generated a name for one of
the Table's children.  It took a little while to track it but basically if
you recursively iterate through the controls collections of the controls on
your page (or, in your case, the controls in TitleBanner), and Trace.Write()
the control IDs and Type, you should be able to track it pretty effectively.
Once you find the "problem child", give it a name and you should be OK.

HTH
----------------
Dave Fancher
http://www.davefancher.com

Show quoteHide quote
"Nathan Sokalski" <njsokal***@hotmail.com> wrote in message
news:u%23eLiBmhFHA.2916@TK2MSFTNGP14.phx.gbl...
> When I view any page in my application a second time, I recieve the
> following error:
>
> [HttpException (0x80004005): Multiple controls with the same ID
> 'TitleBanner:_ctl0' were found. Trace requires that controls have unique
> IDs.]
>   System.Web.TraceContext.AddNewControl(String id, String parentId, String
> type, Int32 viewStateSize) +313
>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState) +201
>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState) +263
>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState) +263
>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState) +263
>   System.Web.UI.Page.ProcessRequestMain() +1608
>
> If I close the browser and Visual Studio, and then reopen and rebuild the
> application I can look at one page in the application one more time, but
> then I recieve the error again. What can I do to prevent this error from
> occurring? If there is any other information that might help figure out
> the problem, I will be happy to give it to you. Here is the entire error
> page I recieve:
>
>
> Server Error in '/' Application.
> --------------------------------------------------------------------------------
>
> Multiple controls with the same ID 'TitleBanner:_ctl0' were found. Trace
> requires that controls have unique IDs.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.Web.HttpException: Multiple controls with the
> same ID 'TitleBanner:_ctl0' were found. Trace requires that controls have
> unique IDs.
>
> Source Error:
>
>      An unhandled exception was generated during the execution of the
> current web request. Information regarding the origin and location of the
> exception can be identified using the exception stack trace below.
>
> Stack Trace:
>
> [HttpException (0x80004005): Multiple controls with the same ID
> 'TitleBanner:_ctl0' were found. Trace requires that controls have unique
> IDs.]
>   System.Web.TraceContext.AddNewControl(String id, String parentId, String
> type, Int32 viewStateSize) +313
>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState) +201
>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState) +263
>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState) +263
>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState) +263
>   System.Web.UI.Page.ProcessRequestMain() +1608
>
>
>
> --------------------------------------------------------------------------------
> Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
> ASP.NET Version:1.1.4322.2032
>      Request Details
>      Session Id: 3nolkd55t1wljc452octxq55 Request Type: GET
>      Time of Request: 7/11/2005 5:29:15 PM Status Code: 500
>      Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
>      Trace Information
>      Category Message From First(s) From Last(s)
>      aspx.page Begin Init
>      aspx.page End Init 0.000021 0.000021
>      aspx.page Begin PreRender 0.000235 0.000215
>      aspx.page End PreRender 0.000260 0.000024
>      Unhandled Execution Error
>      Multiple controls with the same ID 'TitleBanner:_ctl0' were found.
> Trace requires that controls have unique IDs.
>        at System.Web.TraceContext.AddNewControl(String id, String
> parentId, String type, Int32 viewStateSize)
>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState)
>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState)
>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState)
>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> calcViewState)
>        at System.Web.UI.Page.ProcessRequestMain() 0.000584 0.000324
>      Control Tree
>      Control Id Type Render Size Bytes (including children) Viewstate Size
> Bytes (excluding children)
>      __PAGE ASP.index_aspx 0 0
>          _ctl0 System.Web.UI.LiteralControl 0 0
>          TitleBar System.Web.UI.HtmlControls.HtmlGenericControl 0 0
>              _ctl1 System.Web.UI.LiteralControl 0 0
>          _ctl2 System.Web.UI.ResourceBasedLiteralControl 0 0
>          Form1 System.Web.UI.HtmlControls.HtmlForm 0 0
>              _ctl3 System.Web.UI.LiteralControl 0 0
>              TitleBanner ASP.Banner_ascx 0 0
>                  TitleBanner:lblTitle System.Web.UI.WebControls.Label 0 0
>                  TitleBanner:_ctl0 System.Web.UI.LiteralControl 0 0
>      Cookies Collection
>      Name Value Size
>      ASP.NET_SessionId 3nolkd55t1wljc452octxq55 42
>      Headers Collection
>      Name Value
>      Connection Keep-Alive
>      Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/x-shockwave-flash, application/msword, */*
>      Accept-Encoding gzip, deflate
>      Accept-Language en-us
>      Cookie ASP.NET_SessionId=3nolkd55t1wljc452octxq55
>      Host localhost
>      User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
> .NET CLR 1.1.4322)
>      Server Variables
>      Name Value
>      ALL_HTTP HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:image/gif,
> image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash,
> application/msword, */* HTTP_ACCEPT_ENCODING:gzip, deflate
> HTTP_ACCEPT_LANGUAGE:en-us
> HTTP_COOKIE:ASP.NET_SessionId=3nolkd55t1wljc452octxq55 HTTP_HOST:localhost
> HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
> .NET CLR 1.1.4322)
>      ALL_RAW Connection: Keep-Alive Accept: image/gif, image/x-xbitmap,
> image/jpeg, image/pjpeg, application/x-shockwave-flash,
> application/msword, */* Accept-Encoding: gzip, deflate Accept-Language:
> en-us Cookie: ASP.NET_SessionId=3nolkd55t1wljc452octxq55 Host: localhost
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
> CLR 1.1.4322)
>      APPL_MD_PATH /LM/W3SVC/1/ROOT
>      APPL_PHYSICAL_PATH c:\inetpub\wwwroot\
>      AUTH_TYPE
>      AUTH_USER
>      AUTH_PASSWORD
>      LOGON_USER
>      REMOTE_USER
>      CERT_COOKIE
>      CERT_FLAGS
>      CERT_ISSUER
>      CERT_KEYSIZE
>      CERT_SECRETKEYSIZE
>      CERT_SERIALNUMBER
>      CERT_SERVER_ISSUER
>      CERT_SERVER_SUBJECT
>      CERT_SUBJECT
>      CONTENT_LENGTH 0
>      CONTENT_TYPE
>      GATEWAY_INTERFACE CGI/1.1
>      HTTPS off
>      HTTPS_KEYSIZE
>      HTTPS_SECRETKEYSIZE
>      HTTPS_SERVER_ISSUER
>      HTTPS_SERVER_SUBJECT
>      INSTANCE_ID 1
>      INSTANCE_META_PATH /LM/W3SVC/1
>      LOCAL_ADDR 127.0.0.1
>      PATH_INFO /index.aspx
>      PATH_TRANSLATED c:\inetpub\wwwroot\index.aspx
>      QUERY_STRING
>      REMOTE_ADDR 127.0.0.1
>      REMOTE_HOST 127.0.0.1
>      REMOTE_PORT 1361
>      REQUEST_METHOD GET
>      SCRIPT_NAME /index.aspx
>      SERVER_NAME localhost
>      SERVER_PORT 80
>      SERVER_PORT_SECURE 0
>      SERVER_PROTOCOL HTTP/1.1
>      SERVER_SOFTWARE Microsoft-IIS/5.1
>      URL /index.aspx
>      HTTP_CONNECTION Keep-Alive
>      HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/x-shockwave-flash, application/msword, */*
>      HTTP_ACCEPT_ENCODING gzip, deflate
>      HTTP_ACCEPT_LANGUAGE en-us
>      HTTP_COOKIE ASP.NET_SessionId=3nolkd55t1wljc452octxq55
>      HTTP_HOST localhost
>      HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
> SV1; .NET CLR 1.1.4322)
>
>
>
> Thanks.
> --
> Nathan Sokalski
> njsokal***@hotmail.com
> http://www.nathansokalski.com/
>
Author
12 Jul 2005 12:42 PM
Nathan Sokalski
I believe I already know who the "Problem Child" is (the user control
TitleBanner has very few controls in it to begin with). However, giving it a
name would not be an acceptable solution in my case because it is a control
(or set of controls, actually) of which there may be 1, 3, 10, 50, or any
amount, meaning I cannot give them all static names because I will always
need a different number of the controls. I think the real solution (if I can
figure out exactly how to do it) would be to remove the previously existing
control with that ID from memory, which seems to be what happens when I
close the browser and Visual Studio and then rebuild the application. Any
ideas? If you want me to send you the code for the user control, let me know
and I can either attach it to a newsgroup message or email it to you.
Thanks.
--
Nathan Sokalski
njsokal***@hotmail.com
http://www.nathansokalski.com/

Show quoteHide quote
"Dave Fancher" <d***@remove.davefancher.com> wrote in message
news:VvOdncKGwLGFtk7fRVn-hg@comcast.com...
>I had what appears to be the same problem about two weeks ago.  For some
>reason, when I dynamically moved an HtmlTable from one container to another
>(Page into PlaceHolder), the runtime dynamically generated a name for one
>of the Table's children.  It took a little while to track it but basically
>if you recursively iterate through the controls collections of the controls
>on your page (or, in your case, the controls in TitleBanner), and
>Trace.Write() the control IDs and Type, you should be able to track it
>pretty effectively. Once you find the "problem child", give it a name and
>you should be OK.
>
> HTH
> ----------------
> Dave Fancher
> http://www.davefancher.com
>
> "Nathan Sokalski" <njsokal***@hotmail.com> wrote in message
> news:u%23eLiBmhFHA.2916@TK2MSFTNGP14.phx.gbl...
>> When I view any page in my application a second time, I recieve the
>> following error:
>>
>> [HttpException (0x80004005): Multiple controls with the same ID
>> 'TitleBanner:_ctl0' were found. Trace requires that controls have unique
>> IDs.]
>>   System.Web.TraceContext.AddNewControl(String id, String parentId,
>> String type, Int32 viewStateSize) +313
>>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState) +201
>>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState) +263
>>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState) +263
>>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState) +263
>>   System.Web.UI.Page.ProcessRequestMain() +1608
>>
>> If I close the browser and Visual Studio, and then reopen and rebuild the
>> application I can look at one page in the application one more time, but
>> then I recieve the error again. What can I do to prevent this error from
>> occurring? If there is any other information that might help figure out
>> the problem, I will be happy to give it to you. Here is the entire error
>> page I recieve:
>>
>>
>> Server Error in '/' Application.
>> --------------------------------------------------------------------------------
>>
>> Multiple controls with the same ID 'TitleBanner:_ctl0' were found. Trace
>> requires that controls have unique IDs.
>> Description: An unhandled exception occurred during the execution of the
>> current web request. Please review the stack trace for more information
>> about the error and where it originated in the code.
>>
>> Exception Details: System.Web.HttpException: Multiple controls with the
>> same ID 'TitleBanner:_ctl0' were found. Trace requires that controls have
>> unique IDs.
>>
>> Source Error:
>>
>>      An unhandled exception was generated during the execution of the
>> current web request. Information regarding the origin and location of the
>> exception can be identified using the exception stack trace below.
>>
>> Stack Trace:
>>
>> [HttpException (0x80004005): Multiple controls with the same ID
>> 'TitleBanner:_ctl0' were found. Trace requires that controls have unique
>> IDs.]
>>   System.Web.TraceContext.AddNewControl(String id, String parentId,
>> String type, Int32 viewStateSize) +313
>>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState) +201
>>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState) +263
>>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState) +263
>>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState) +263
>>   System.Web.UI.Page.ProcessRequestMain() +1608
>>
>>
>>
>> --------------------------------------------------------------------------------
>> Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
>> ASP.NET Version:1.1.4322.2032
>>      Request Details
>>      Session Id: 3nolkd55t1wljc452octxq55 Request Type: GET
>>      Time of Request: 7/11/2005 5:29:15 PM Status Code: 500
>>      Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
>>      Trace Information
>>      Category Message From First(s) From Last(s)
>>      aspx.page Begin Init
>>      aspx.page End Init 0.000021 0.000021
>>      aspx.page Begin PreRender 0.000235 0.000215
>>      aspx.page End PreRender 0.000260 0.000024
>>      Unhandled Execution Error
>>      Multiple controls with the same ID 'TitleBanner:_ctl0' were found.
>> Trace requires that controls have unique IDs.
>>        at System.Web.TraceContext.AddNewControl(String id, String
>> parentId, String type, Int32 viewStateSize)
>>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState)
>>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState)
>>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState)
>>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
>> calcViewState)
>>        at System.Web.UI.Page.ProcessRequestMain() 0.000584 0.000324
>>      Control Tree
>>      Control Id Type Render Size Bytes (including children) Viewstate
>> Size Bytes (excluding children)
>>      __PAGE ASP.index_aspx 0 0
>>          _ctl0 System.Web.UI.LiteralControl 0 0
>>          TitleBar System.Web.UI.HtmlControls.HtmlGenericControl 0 0
>>              _ctl1 System.Web.UI.LiteralControl 0 0
>>          _ctl2 System.Web.UI.ResourceBasedLiteralControl 0 0
>>          Form1 System.Web.UI.HtmlControls.HtmlForm 0 0
>>              _ctl3 System.Web.UI.LiteralControl 0 0
>>              TitleBanner ASP.Banner_ascx 0 0
>>                  TitleBanner:lblTitle System.Web.UI.WebControls.Label 0 0
>>                  TitleBanner:_ctl0 System.Web.UI.LiteralControl 0 0
>>      Cookies Collection
>>      Name Value Size
>>      ASP.NET_SessionId 3nolkd55t1wljc452octxq55 42
>>      Headers Collection
>>      Name Value
>>      Connection Keep-Alive
>>      Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
>> application/x-shockwave-flash, application/msword, */*
>>      Accept-Encoding gzip, deflate
>>      Accept-Language en-us
>>      Cookie ASP.NET_SessionId=3nolkd55t1wljc452octxq55
>>      Host localhost
>>      User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
>> .NET CLR 1.1.4322)
>>      Server Variables
>>      Name Value
>>      ALL_HTTP HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:image/gif,
>> image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash,
>> application/msword, */* HTTP_ACCEPT_ENCODING:gzip, deflate
>> HTTP_ACCEPT_LANGUAGE:en-us
>> HTTP_COOKIE:ASP.NET_SessionId=3nolkd55t1wljc452octxq55
>> HTTP_HOST:localhost HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0;
>> Windows NT 5.1; SV1; .NET CLR 1.1.4322)
>>      ALL_RAW Connection: Keep-Alive Accept: image/gif, image/x-xbitmap,
>> image/jpeg, image/pjpeg, application/x-shockwave-flash,
>> application/msword, */* Accept-Encoding: gzip, deflate Accept-Language:
>> en-us Cookie: ASP.NET_SessionId=3nolkd55t1wljc452octxq55 Host: localhost
>> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
>> CLR 1.1.4322)
>>      APPL_MD_PATH /LM/W3SVC/1/ROOT
>>      APPL_PHYSICAL_PATH c:\inetpub\wwwroot\
>>      AUTH_TYPE
>>      AUTH_USER
>>      AUTH_PASSWORD
>>      LOGON_USER
>>      REMOTE_USER
>>      CERT_COOKIE
>>      CERT_FLAGS
>>      CERT_ISSUER
>>      CERT_KEYSIZE
>>      CERT_SECRETKEYSIZE
>>      CERT_SERIALNUMBER
>>      CERT_SERVER_ISSUER
>>      CERT_SERVER_SUBJECT
>>      CERT_SUBJECT
>>      CONTENT_LENGTH 0
>>      CONTENT_TYPE
>>      GATEWAY_INTERFACE CGI/1.1
>>      HTTPS off
>>      HTTPS_KEYSIZE
>>      HTTPS_SECRETKEYSIZE
>>      HTTPS_SERVER_ISSUER
>>      HTTPS_SERVER_SUBJECT
>>      INSTANCE_ID 1
>>      INSTANCE_META_PATH /LM/W3SVC/1
>>      LOCAL_ADDR 127.0.0.1
>>      PATH_INFO /index.aspx
>>      PATH_TRANSLATED c:\inetpub\wwwroot\index.aspx
>>      QUERY_STRING
>>      REMOTE_ADDR 127.0.0.1
>>      REMOTE_HOST 127.0.0.1
>>      REMOTE_PORT 1361
>>      REQUEST_METHOD GET
>>      SCRIPT_NAME /index.aspx
>>      SERVER_NAME localhost
>>      SERVER_PORT 80
>>      SERVER_PORT_SECURE 0
>>      SERVER_PROTOCOL HTTP/1.1
>>      SERVER_SOFTWARE Microsoft-IIS/5.1
>>      URL /index.aspx
>>      HTTP_CONNECTION Keep-Alive
>>      HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
>> application/x-shockwave-flash, application/msword, */*
>>      HTTP_ACCEPT_ENCODING gzip, deflate
>>      HTTP_ACCEPT_LANGUAGE en-us
>>      HTTP_COOKIE ASP.NET_SessionId=3nolkd55t1wljc452octxq55
>>      HTTP_HOST localhost
>>      HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
>> SV1; .NET CLR 1.1.4322)
>>
>>
>>
>> Thanks.
>> --
>> Nathan Sokalski
>> njsokal***@hotmail.com
>> http://www.nathansokalski.com/
>>
>
>
Author
12 Jul 2005 3:52 PM
Dave Fancher
Go ahead and send it to me (d***@remove.davefancher.com - remember to remove
"remove").  I'll take a look at it this afternoon.

HTH
----
http://www.davefancher.com


Show quoteHide quote
"Nathan Sokalski" wrote:

> I believe I already know who the "Problem Child" is (the user control
> TitleBanner has very few controls in it to begin with). However, giving it a
> name would not be an acceptable solution in my case because it is a control
> (or set of controls, actually) of which there may be 1, 3, 10, 50, or any
> amount, meaning I cannot give them all static names because I will always
> need a different number of the controls. I think the real solution (if I can
> figure out exactly how to do it) would be to remove the previously existing
> control with that ID from memory, which seems to be what happens when I
> close the browser and Visual Studio and then rebuild the application. Any
> ideas? If you want me to send you the code for the user control, let me know
> and I can either attach it to a newsgroup message or email it to you.
> Thanks.
> --
> Nathan Sokalski
> njsokal***@hotmail.com
> http://www.nathansokalski.com/
>
> "Dave Fancher" <d***@remove.davefancher.com> wrote in message
> news:VvOdncKGwLGFtk7fRVn-hg@comcast.com...
> >I had what appears to be the same problem about two weeks ago.  For some
> >reason, when I dynamically moved an HtmlTable from one container to another
> >(Page into PlaceHolder), the runtime dynamically generated a name for one
> >of the Table's children.  It took a little while to track it but basically
> >if you recursively iterate through the controls collections of the controls
> >on your page (or, in your case, the controls in TitleBanner), and
> >Trace.Write() the control IDs and Type, you should be able to track it
> >pretty effectively. Once you find the "problem child", give it a name and
> >you should be OK.
> >
> > HTH
> > ----------------
> > Dave Fancher
> > http://www.davefancher.com
> >
> > "Nathan Sokalski" <njsokal***@hotmail.com> wrote in message
> > news:u%23eLiBmhFHA.2916@TK2MSFTNGP14.phx.gbl...
> >> When I view any page in my application a second time, I recieve the
> >> following error:
> >>
> >> [HttpException (0x80004005): Multiple controls with the same ID
> >> 'TitleBanner:_ctl0' were found. Trace requires that controls have unique
> >> IDs.]
> >>   System.Web.TraceContext.AddNewControl(String id, String parentId,
> >> String type, Int32 viewStateSize) +313
> >>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState) +201
> >>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState) +263
> >>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState) +263
> >>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState) +263
> >>   System.Web.UI.Page.ProcessRequestMain() +1608
> >>
> >> If I close the browser and Visual Studio, and then reopen and rebuild the
> >> application I can look at one page in the application one more time, but
> >> then I recieve the error again. What can I do to prevent this error from
> >> occurring? If there is any other information that might help figure out
> >> the problem, I will be happy to give it to you. Here is the entire error
> >> page I recieve:
> >>
> >>
> >> Server Error in '/' Application.
> >> --------------------------------------------------------------------------------
> >>
> >> Multiple controls with the same ID 'TitleBanner:_ctl0' were found. Trace
> >> requires that controls have unique IDs.
> >> Description: An unhandled exception occurred during the execution of the
> >> current web request. Please review the stack trace for more information
> >> about the error and where it originated in the code.
> >>
> >> Exception Details: System.Web.HttpException: Multiple controls with the
> >> same ID 'TitleBanner:_ctl0' were found. Trace requires that controls have
> >> unique IDs.
> >>
> >> Source Error:
> >>
> >>      An unhandled exception was generated during the execution of the
> >> current web request. Information regarding the origin and location of the
> >> exception can be identified using the exception stack trace below.
> >>
> >> Stack Trace:
> >>
> >> [HttpException (0x80004005): Multiple controls with the same ID
> >> 'TitleBanner:_ctl0' were found. Trace requires that controls have unique
> >> IDs.]
> >>   System.Web.TraceContext.AddNewControl(String id, String parentId,
> >> String type, Int32 viewStateSize) +313
> >>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState) +201
> >>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState) +263
> >>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState) +263
> >>   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState) +263
> >>   System.Web.UI.Page.ProcessRequestMain() +1608
> >>
> >>
> >>
> >> --------------------------------------------------------------------------------
> >> Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
> >> ASP.NET Version:1.1.4322.2032
> >>      Request Details
> >>      Session Id: 3nolkd55t1wljc452octxq55 Request Type: GET
> >>      Time of Request: 7/11/2005 5:29:15 PM Status Code: 500
> >>      Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
> >>      Trace Information
> >>      Category Message From First(s) From Last(s)
> >>      aspx.page Begin Init
> >>      aspx.page End Init 0.000021 0.000021
> >>      aspx.page Begin PreRender 0.000235 0.000215
> >>      aspx.page End PreRender 0.000260 0.000024
> >>      Unhandled Execution Error
> >>      Multiple controls with the same ID 'TitleBanner:_ctl0' were found.
> >> Trace requires that controls have unique IDs.
> >>        at System.Web.TraceContext.AddNewControl(String id, String
> >> parentId, String type, Int32 viewStateSize)
> >>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState)
> >>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState)
> >>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState)
> >>        at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean
> >> calcViewState)
> >>        at System.Web.UI.Page.ProcessRequestMain() 0.000584 0.000324
> >>      Control Tree
> >>      Control Id Type Render Size Bytes (including children) Viewstate
> >> Size Bytes (excluding children)
> >>      __PAGE ASP.index_aspx 0 0
> >>          _ctl0 System.Web.UI.LiteralControl 0 0
> >>          TitleBar System.Web.UI.HtmlControls.HtmlGenericControl 0 0
> >>              _ctl1 System.Web.UI.LiteralControl 0 0
> >>          _ctl2 System.Web.UI.ResourceBasedLiteralControl 0 0
> >>          Form1 System.Web.UI.HtmlControls.HtmlForm 0 0
> >>              _ctl3 System.Web.UI.LiteralControl 0 0
> >>              TitleBanner ASP.Banner_ascx 0 0
> >>                  TitleBanner:lblTitle System.Web.UI.WebControls.Label 0 0
> >>                  TitleBanner:_ctl0 System.Web.UI.LiteralControl 0 0
> >>      Cookies Collection
> >>      Name Value Size
> >>      ASP.NET_SessionId 3nolkd55t1wljc452octxq55 42
> >>      Headers Collection
> >>      Name Value
> >>      Connection Keep-Alive
> >>      Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> >> application/x-shockwave-flash, application/msword, */*
> >>      Accept-Encoding gzip, deflate
> >>      Accept-Language en-us
> >>      Cookie ASP.NET_SessionId=3nolkd55t1wljc452octxq55
> >>      Host localhost
> >>      User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
> >> .NET CLR 1.1.4322)
> >>      Server Variables
> >>      Name Value
> >>      ALL_HTTP HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:image/gif,
> >> image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash,
> >> application/msword, */* HTTP_ACCEPT_ENCODING:gzip, deflate
> >> HTTP_ACCEPT_LANGUAGE:en-us
> >> HTTP_COOKIE:ASP.NET_SessionId=3nolkd55t1wljc452octxq55
> >> HTTP_HOST:localhost HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0;
> >> Windows NT 5.1; SV1; .NET CLR 1.1.4322)
> >>      ALL_RAW Connection: Keep-Alive Accept: image/gif, image/x-xbitmap,
> >> image/jpeg, image/pjpeg, application/x-shockwave-flash,
> >> application/msword, */* Accept-Encoding: gzip, deflate Accept-Language:
> >> en-us Cookie: ASP.NET_SessionId=3nolkd55t1wljc452octxq55 Host: localhost
> >> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
> >> CLR 1.1.4322)
> >>      APPL_MD_PATH /LM/W3SVC/1/ROOT
> >>      APPL_PHYSICAL_PATH c:\inetpub\wwwroot\
> >>      AUTH_TYPE
> >>      AUTH_USER
> >>      AUTH_PASSWORD
> >>      LOGON_USER
> >>      REMOTE_USER
> >>      CERT_COOKIE
> >>      CERT_FLAGS
> >>      CERT_ISSUER
> >>      CERT_KEYSIZE
> >>      CERT_SECRETKEYSIZE
> >>      CERT_SERIALNUMBER
> >>      CERT_SERVER_ISSUER
> >>      CERT_SERVER_SUBJECT
> >>      CERT_SUBJECT
> >>      CONTENT_LENGTH 0
> >>      CONTENT_TYPE
> >>      GATEWAY_INTERFACE CGI/1.1
> >>      HTTPS off
> >>      HTTPS_KEYSIZE
> >>      HTTPS_SECRETKEYSIZE
> >>      HTTPS_SERVER_ISSUER
> >>      HTTPS_SERVER_SUBJECT
> >>      INSTANCE_ID 1
> >>      INSTANCE_META_PATH /LM/W3SVC/1
> >>      LOCAL_ADDR 127.0.0.1
> >>      PATH_INFO /index.aspx
> >>      PATH_TRANSLATED c:\inetpub\wwwroot\index.aspx
> >>      QUERY_STRING
> >>      REMOTE_ADDR 127.0.0.1
> >>      REMOTE_HOST 127.0.0.1
> >>      REMOTE_PORT 1361
> >>      REQUEST_METHOD GET
> >>      SCRIPT_NAME /index.aspx
> >>      SERVER_NAME localhost
> >>      SERVER_PORT 80
> >>      SERVER_PORT_SECURE 0
> >>      SERVER_PROTOCOL HTTP/1.1
> >>      SERVER_SOFTWARE Microsoft-IIS/5.1
> >>      URL /index.aspx
> >>      HTTP_CONNECTION Keep-Alive
> >>      HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> >> application/x-shockwave-flash, application/msword, */*
> >>      HTTP_ACCEPT_ENCODING gzip, deflate
> >>      HTTP_ACCEPT_LANGUAGE en-us
> >>      HTTP_COOKIE ASP.NET_SessionId=3nolkd55t1wljc452octxq55
> >>      HTTP_HOST localhost
> >>      HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
> >> SV1; .NET CLR 1.1.4322)
> >>
> >>
> >>
> >> Thanks.
> >> --
> >> Nathan Sokalski
> >> njsokal***@hotmail.com
> >> http://www.nathansokalski.com/
> >>
> >
> >
>
>
>