Strange Error when viewing page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nathan Sokalski

    Strange Error when viewing page

    When I view my index.aspx page any time after the first time, I recieve the
    following error:

    [HttpException (0x80004005): Multiple controls with the same ID
    'TitleBanner:_c tl0' were found. Trace requires that controls have unique
    IDs.]
    System.Web.Trac eContext.AddNew Control(String id, String parentId, String
    type, Int32 viewStateSize) +313
    System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
    calcViewState) +201
    System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
    calcViewState) +263
    System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
    calcViewState) +263
    System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
    calcViewState) +263
    System.Web.UI.P age.ProcessRequ estMain() +1633

    TitleBanner is a user control on my page. Because I do not recieve this
    error the very first time I view the page after compiling it, ASP.NET is
    obviously remembering the control after I view the page the first time. I
    find this error strange because _ctl0 is an automatically generated name, so
    how can there be two controls with that name? I also find it strange that
    the error only seems to occur on my index.aspx page, even though the control
    is used in exactly the same way (same parameters and properties) on another
    page in the same directory, and it does not give me an error there even when
    I view it multiple times. Why might this be happening, and what might I be
    able to do to fix it? Thanks.
    --
    Nathan Sokalski
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。



  • Cor Ligthert

    #2
    Re: Strange Error when viewing page

    Nathan,

    First question,
    Are you dynamicly building controls?

    Cor


    Comment

    • Ken Tucker [MVP]

      #3
      RE: Strange Error when viewing page

      Hi,

      If you are adding the control to the webpage via code do not add
      it again when the page is posting back.

      If not me.postback then
      ' add the control here
      end if

      Ken
      ----------------------------

      "Nathan Sokalski" wrote:
      [color=blue]
      > When I view my index.aspx page any time after the first time, I recieve the
      > following error:
      >
      > [HttpException (0x80004005): Multiple controls with the same ID
      > 'TitleBanner:_c tl0' were found. Trace requires that controls have unique
      > IDs.]
      > System.Web.Trac eContext.AddNew Control(String id, String parentId, String
      > type, Int32 viewStateSize) +313
      > System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
      > calcViewState) +201
      > System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
      > calcViewState) +263
      > System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
      > calcViewState) +263
      > System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
      > calcViewState) +263
      > System.Web.UI.P age.ProcessRequ estMain() +1633
      >
      > TitleBanner is a user control on my page. Because I do not recieve this
      > error the very first time I view the page after compiling it, ASP.NET is
      > obviously remembering the control after I view the page the first time. I
      > find this error strange because _ctl0 is an automatically generated name, so
      > how can there be two controls with that name? I also find it strange that
      > the error only seems to occur on my index.aspx page, even though the control
      > is used in exactly the same way (same parameters and properties) on another
      > page in the same directory, and it does not give me an error there even when
      > I view it multiple times. Why might this be happening, and what might I be
      > able to do to fix it? Thanks.
      > --
      > Nathan Sokalski
      > njsokalski@hotm ail.com
      > http://www.nathansokalski.com/
      >
      >
      >[/color]

      Comment

      • Nathan Sokalski

        #4
        Re: Strange Error when viewing page

        Yes, I am. The place that it looks like the error occurs (which is pretty
        early in my code based on what I can tell, since the control it says it
        finds multiple times is pretty early in the Control Tree it displays). A
        note that I want to make about this control, however, is that is a control
        that I generate in the Application_Sta rt procedure and store in a collection
        in the global.asax.vb file, so it is really only generated once (unless the
        cache dependency removes it from cache, in which case it is generated
        again). Here is my control tree, which you can see is pretty small since it
        doesn't get very far:


        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.L iteralControl 0 0
        TitleBar System.Web.UI.H tmlControls.Htm lGenericControl 0 0
        _ctl1 System.Web.UI.L iteralControl 0 0
        _ctl2 System.Web.UI.R esourceBasedLit eralControl 0 0
        Form1 System.Web.UI.H tmlControls.Htm lForm 0 0
        _ctl3 System.Web.UI.L iteralControl 0 0
        TitleBanner ASP.Banner_ascx 0 0
        TitleBanner:lbl Title System.Web.UI.W ebControls.Labe l 0 0
        TitleBanner:_ct l0 System.Web.UI.L iteralControl 0 0



        My other control, which the application never even gets to which I use for
        navigation on all my pages, actually does generate the controls every time.
        If you need any more info, I will be happy to give you anything I can.
        Thanks.
        --
        Nathan Sokalski
        njsokalski@hotm ail.com
        有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

        "Cor Ligthert" <notmyfirstname @planet.nl> wrote in message
        news:%237wgeAkd FHA.2288@TK2MSF TNGP14.phx.gbl. ..[color=blue]
        > Nathan,
        >
        > First question,
        > Are you dynamicly building controls?
        >
        > Cor
        >[/color]


        Comment

        • Nathan Sokalski

          #5
          Re: Strange Error when viewing page

          I do not add the user control via code, the user control is always there.
          The basic layout of the control that it looks like the error is occurring in
          is as follows:



          LABEL CONTROL

          imagecontrol imagecontrol imagecontrol



          The basic purpose of the user control is to display the title and navigation
          bar. The imagecontrols, which are the navigation, are generated when the
          application is started in the Application_Sta rt procedure, and are then
          stored in a collection in the global.asax.vb file. The only time they would
          be generated a second time would be if they were removed from the
          application cache (I created cache dependencies for this). I also want to
          point out that even though my diagram above says imagecontrol 3 times, the
          page in error only places one there (other pages would place more, but this
          page only has one). My control tree (or at least the part shown in the
          error) is as follows:


          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.L iteralControl 0 0
          TitleBar System.Web.UI.H tmlControls.Htm lGenericControl 0 0
          _ctl1 System.Web.UI.L iteralControl 0 0
          _ctl2 System.Web.UI.R esourceBasedLit eralControl 0 0
          Form1 System.Web.UI.H tmlControls.Htm lForm 0 0
          _ctl3 System.Web.UI.L iteralControl 0 0
          TitleBanner ASP.Banner_ascx 0 0
          TitleBanner:lbl Title System.Web.UI.W ebControls.Labe l 0 0
          TitleBanner:_ct l0 System.Web.UI.L iteralControl 0 0



          I am having trouble figuring out what the LiteralControl that it stops at
          is, because the user control TitleBanner does not create or use any
          LiteralControls . All I can think of is that somehow ASP.NET is labeling the
          <BR> tag as a LiteralControl, even though the tag is just there. If there is
          any more information that might be useful in figuring out the problem, let
          me know and I will be happy to give it to you. Thanks.
          --
          Nathan Sokalski
          njsokalski@hotm ail.com
          有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

          "Ken Tucker [MVP]" <KenTuckerMVP@d iscussions.micr osoft.com> wrote in message
          news:4185E94C-784F-4CCF-B060-555ADEC219BB@mi crosoft.com...[color=blue]
          > Hi,
          >
          > If you are adding the control to the webpage via code do not add
          > it again when the page is posting back.
          >
          > If not me.postback then
          > ' add the control here
          > end if
          >
          > Ken
          > ----------------------------
          >
          > "Nathan Sokalski" wrote:
          >[color=green]
          >> When I view my index.aspx page any time after the first time, I recieve
          >> the
          >> following error:
          >>
          >> [HttpException (0x80004005): Multiple controls with the same ID
          >> 'TitleBanner:_c tl0' were found. Trace requires that controls have unique
          >> IDs.]
          >> System.Web.Trac eContext.AddNew Control(String id, String parentId,
          >> String
          >> type, Int32 viewStateSize) +313
          >> System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
          >> calcViewState) +201
          >> System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
          >> calcViewState) +263
          >> System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
          >> calcViewState) +263
          >> System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
          >> calcViewState) +263
          >> System.Web.UI.P age.ProcessRequ estMain() +1633
          >>
          >> TitleBanner is a user control on my page. Because I do not recieve this
          >> error the very first time I view the page after compiling it, ASP.NET is
          >> obviously remembering the control after I view the page the first time. I
          >> find this error strange because _ctl0 is an automatically generated name,
          >> so
          >> how can there be two controls with that name? I also find it strange that
          >> the error only seems to occur on my index.aspx page, even though the
          >> control
          >> is used in exactly the same way (same parameters and properties) on
          >> another
          >> page in the same directory, and it does not give me an error there even
          >> when
          >> I view it multiple times. Why might this be happening, and what might I
          >> be
          >> able to do to fix it? Thanks.
          >> --
          >> Nathan Sokalski
          >> njsokalski@hotm ail.com
          >> http://www.nathansokalski.com/
          >>
          >>
          >>[/color][/color]


          Comment

          • Nathan Sokalski

            #6
            Re: Strange Error when viewing page

            Yes, I am. The place that it looks like the error occurs (which is pretty
            early in my code based on what I can tell, since the control it says it
            finds multiple times is pretty early in the Control Tree it displays). A
            note that I want to make about this control, however, is that is a control
            that I generate in the Application_Sta rt procedure and store in a collection
            in the global.asax.vb file, so it is really only generated once (unless the
            cache dependency removes it from cache, in which case it is generated
            again). Here is my control tree, which you can see is pretty small since it
            doesn't get very far:


            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.L iteralControl 0 0
            TitleBar System.Web.UI.H tmlControls.Htm lGenericControl 0 0
            _ctl1 System.Web.UI.L iteralControl 0 0
            _ctl2 System.Web.UI.R esourceBasedLit eralControl 0 0
            Form1 System.Web.UI.H tmlControls.Htm lForm 0 0
            _ctl3 System.Web.UI.L iteralControl 0 0
            TitleBanner ASP.Banner_ascx 0 0
            TitleBanner:lbl Title System.Web.UI.W ebControls.Labe l 0 0
            TitleBanner:_ct l0 System.Web.UI.L iteralControl 0 0



            My other control, which the application never even gets to which I use for
            navigation on all my pages, actually does generate the controls every time.
            If you need any more info, I will be happy to give you anything I can.
            Thanks.
            --
            Nathan Sokalski
            njsokalski@hotm ail.com
            有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

            "Cor Ligthert" <notmyfirstname @planet.nl> wrote in message
            news:%237wgeAkd FHA.2288@TK2MSF TNGP14.phx.gbl. ..[color=blue]
            > Nathan,
            >
            > First question,
            > Are you dynamicly building controls?
            >
            > Cor
            >[/color]


            Comment

            • Nathan Sokalski

              #7
              Re: Strange Error when viewing page

              I do not add the user control via code, the user control is always there.
              The basic layout of the control that it looks like the error is occurring in
              is as follows:



              LABEL CONTROL

              imagecontrol imagecontrol imagecontrol



              The basic purpose of the user control is to display the title and navigation
              bar. The imagecontrols, which are the navigation, are generated when the
              application is started in the Application_Sta rt procedure, and are then
              stored in a collection in the global.asax.vb file. The only time they would
              be generated a second time would be if they were removed from the
              application cache (I created cache dependencies for this). I also want to
              point out that even though my diagram above says imagecontrol 3 times, the
              page in error only places one there (other pages would place more, but this
              page only has one). My control tree (or at least the part shown in the
              error) is as follows:


              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.L iteralControl 0 0
              TitleBar System.Web.UI.H tmlControls.Htm lGenericControl 0 0
              _ctl1 System.Web.UI.L iteralControl 0 0
              _ctl2 System.Web.UI.R esourceBasedLit eralControl 0 0
              Form1 System.Web.UI.H tmlControls.Htm lForm 0 0
              _ctl3 System.Web.UI.L iteralControl 0 0
              TitleBanner ASP.Banner_ascx 0 0
              TitleBanner:lbl Title System.Web.UI.W ebControls.Labe l 0 0
              TitleBanner:_ct l0 System.Web.UI.L iteralControl 0 0



              I am having trouble figuring out what the LiteralControl that it stops at
              is, because the user control TitleBanner does not create or use any
              LiteralControls . All I can think of is that somehow ASP.NET is labeling the
              <BR> tag as a LiteralControl, even though the tag is just there. If there is
              any more information that might be useful in figuring out the problem, let
              me know and I will be happy to give it to you. Thanks.
              --
              Nathan Sokalski
              njsokalski@hotm ail.com
              有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

              "Ken Tucker [MVP]" <KenTuckerMVP@d iscussions.micr osoft.com> wrote in message
              news:4185E94C-784F-4CCF-B060-555ADEC219BB@mi crosoft.com...[color=blue]
              > Hi,
              >
              > If you are adding the control to the webpage via code do not add
              > it again when the page is posting back.
              >
              > If not me.postback then
              > ' add the control here
              > end if
              >
              > Ken
              > ----------------------------
              >
              > "Nathan Sokalski" wrote:
              >[color=green]
              >> When I view my index.aspx page any time after the first time, I recieve
              >> the
              >> following error:
              >>
              >> [HttpException (0x80004005): Multiple controls with the same ID
              >> 'TitleBanner:_c tl0' were found. Trace requires that controls have unique
              >> IDs.]
              >> System.Web.Trac eContext.AddNew Control(String id, String parentId,
              >> String
              >> type, Int32 viewStateSize) +313
              >> System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
              >> calcViewState) +201
              >> System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
              >> calcViewState) +263
              >> System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
              >> calcViewState) +263
              >> System.Web.UI.C ontrol.BuildPro fileTree(String parentId, Boolean
              >> calcViewState) +263
              >> System.Web.UI.P age.ProcessRequ estMain() +1633
              >>
              >> TitleBanner is a user control on my page. Because I do not recieve this
              >> error the very first time I view the page after compiling it, ASP.NET is
              >> obviously remembering the control after I view the page the first time. I
              >> find this error strange because _ctl0 is an automatically generated name,
              >> so
              >> how can there be two controls with that name? I also find it strange that
              >> the error only seems to occur on my index.aspx page, even though the
              >> control
              >> is used in exactly the same way (same parameters and properties) on
              >> another
              >> page in the same directory, and it does not give me an error there even
              >> when
              >> I view it multiple times. Why might this be happening, and what might I
              >> be
              >> able to do to fix it? Thanks.
              >> --
              >> Nathan Sokalski
              >> njsokalski@hotm ail.com
              >> http://www.nathansokalski.com/
              >>
              >>
              >>[/color][/color]


              Comment

              • Cor Ligthert

                #8
                Re: Strange Error when viewing page

                Nathan,

                I think that the way you are doing it, is so special, that I can not give
                you any help in this.

                Sorry

                Cor


                Comment

                • Cor Ligthert

                  #9
                  Re: Strange Error when viewing page

                  Nathan,

                  I think that the way you are doing it, is so special, that I can not give
                  you any help in this.

                  Sorry

                  Cor


                  Comment

                  Working...