Geeks With Blogs

Michael Freidgeim's Blog MS .Net Development
Our application has the intermittent (not too often,but can be 10-20 per day) errors like the following:
An error has occurred because a control with id 'grdComplaints$ctl04$ctl00' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.
 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +877
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I've tried advice from http://p2p.wrox.com/TopicIndex/45979.htm  -
  "EnableViewState Property was set to 'False' when i change it to 'True' it becomes functional."
but it didn't eliminate errors.
Not sure, how to make the problem reproducible. I have some suspicion that it is relatted to An error "An entry with the same key already exists" when assigning ImageButton.ImageUrl
Posted on Monday, May 5, 2008 11:15 PM | Back to top


Comments on this post: Error: control with id ... could not be located or a different control is assigned to the same ID after postback

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
Hi

I also facing the same problem.

"EnableViewState Property of grid is by default 'TRUE' when i change it to 'FALSE' it becomes functional."
but my other functionality does'nt work.
Can you give me some idea.

Thanks
Bhavana
Left by Bhavana Chaturvedi on Jun 22, 2008 5:10 PM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
In my application it is intermittent error, that I can see in production event log only, but can't reproduce in development/test environment. So still no ideas, what causes it.
Left by Michael Freidgeim on Jun 29, 2008 10:47 PM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
Bhavana Chaturvedi,
If you are using dynamic controls, I strongly recommend to read a great atricle: TRULY Understanding Dynamic Controls -Parts 1-4(http://weblogs.asp.net/infinitiesloop/archive/2006/08/25/TRULY-Understanding-Dynamic-Controls-_2800_Part-1_2900_.aspx) and avoid to use them if possible.
Left by Michael Freidgeim on Jun 29, 2008 10:58 PM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
Hey, i am also getting the same error. In my case, when click previous page index of a GridViewm the error is being shown. I am wandering in the Internet for the solution.
Left by sangam on Nov 04, 2008 6:13 PM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
I too had this error. I was creating dynamic controls (imagebuttons) in a gridview. When filtering the gridview, sometimes I would get the error and sometimes not.

I added unique IDs to each control when I created them and it solved the problem.
Left by Glenn on Mar 27, 2009 7:01 AM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
I have added /QueryStringField="pageNum"/.
It has helped
Left by Sergey on May 25, 2009 3:50 AM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
The solution with adding the unique IDs is working to me. Thanks
Left by Alvin on Feb 12, 2010 8:14 AM

# re: Error:in adding gridview record the error is object instance is not created
Requesting Gravatar...
gve reply...
Left by ccc on Jun 25, 2012 9:18 PM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
How to unique id to dynamic controls? Please someone help
Left by Dharsana on Jan 17, 2014 9:24 PM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
How to create unique id to dynamic controls? Please someone help
Left by Dharsana on Jan 17, 2014 9:26 PM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
Same question, how to create unique id to dynamic controls?
Thanks a lot !
Left by Blud on Feb 20, 2014 1:36 AM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
The problem was that i had a column.DataField = "".
Left by Blud on Feb 20, 2014 2:59 AM

# re: Error: control with id ... could not be located or a different control is assigned to the same ID after postback
Requesting Gravatar...
System.Web.HttpException: An error has occurred because a control with id 'ctl00$ContentPlaceHolder1$GVCart$ctl02$ctl01' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error
Left by rajeev on May 21, 2015 6:14 PM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net | Join free