Multiple controls with the same ID, Failed to load viewstate

Discussion in 'ASP .Net Web Controls' started by Eamonn O'Connell, Jul 17, 2007.

  1. Hi,

    I am load-testing a VB.NET 1.1 web app and have encountered the following
    two errors:

    1) Multiple controls with the same ID 'CheckBox1' were found. FindControl
    requires that controls have unique IDs.

    2) Failed to load viewstate. The control tree into which viewstate is being
    loaded must match the control tree that was used to save viewstate during
    the previous request. For example, when adding controls dynamically, the
    controls added during a post-back must match the type and position of the
    controls added during the initial request.

    These errors appear to happen randomly, around 2% of the time i.e. normally
    the page works fine, then randomly oneof the above errors will happen. These
    errors do not happen if a low number of users are using the site. The errors
    happen on a page where we dynamically add controls. The controls are
    dynamically created during the Page_Init event.

    (The server is Windows Server 2003 - Web Edition - Service Pack 2. I know
    that the 'Multiple controls' error can happen in an earlier release of .NET
    framework 1.1, however the above service pack means this should not be the
    cause of the error we are getting.)

    Has anyone else see these errors happen like this before?
    The full text of the messages are presented below.

    Many thanks,
    Eamonn O'Connell
    -------------------------------------------------------------------------------
    Multiple controls with the same ID 'CheckBox1' were found. FindControl
    requires that controls have unique IDs.

    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer,
    ControlCollection controls)
    at System.Web.UI.Control.FindControl(String id, Int32 pathOffset)
    at System.Web.UI.Control.FindControl(String id)
    at System.Web.UI.Page.ProcessPostData(NameValueCollection postData,
    Boolean fBeforeLoad)
    at System.Web.UI.Page.ProcessRequestMain()
    -------------------------------------------------------------------------------
    Failed to load viewstate. The control tree into which viewstate is being
    loaded must match the control tree that was used to save viewstate during
    the previous request. For example, when adding controls dynamically, the
    controls added during a post-back must match the type and position of the
    controls added during the initial request.

    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
    at System.Web.UI.Control.AddedControl(Control control, Int32 index)
    at System.Web.UI.ControlCollection.Add(Control child)
    at OC_WebControls.TocControlContainer.CreateControls(ResourceManager
    resourceManager, WebControlFactory controlFactory, DataRow[] controlRows,
    Hashtable parentControls, Int32 parentWidth)
    at OC_WebControls.TocRepeatingSection.AddSingleControlRow()
    at OC_WebControls.TocRepeatingSection.EnsureChildControls()
    at OC_WebControls.TocRepeatingSection.TocRepeatingSection_Load(Object
    sender, EventArgs e)
    at System.Web.UI.Control.OnLoad(EventArgs e)
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Page.ProcessRequestMain()
    Eamonn O'Connell, Jul 17, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Invalidlastname
    Replies:
    7
    Views:
    818
    Steven Cheng[MSFT]
    Jan 16, 2004
  2. Sinisa Ruzin
    Replies:
    0
    Views:
    861
    Sinisa Ruzin
    Oct 7, 2004
  3. sck10
    Replies:
    6
    Views:
    909
    sck10
    Sep 1, 2006
  4. Josema
    Replies:
    2
    Views:
    345
  5. Josema
    Replies:
    0
    Views:
    206
    Josema
    May 9, 2005
Loading...

Share This Page