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

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 @ Monday, May 5, 2008 11:15 PM
Print

Comments on this entry:

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

Left by Bhavana Chaturvedi at 6/22/2008 5:10 PM
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

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

Left by Michael Freidgeim at 6/29/2008 10:47 PM
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.

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

Left by Michael Freidgeim at 6/29/2008 10:58 PM
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.

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

Left by sangam at 11/4/2008 6:13 PM
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.

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

Left by Glenn at 3/27/2009 7:01 AM
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.

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

Left by Sergey at 5/25/2009 3:50 AM
Gravatar
I have added /QueryStringField="pageNum"/.
It has helped

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

Left by Alvin at 2/12/2010 8:14 AM
Gravatar
The solution with adding the unique IDs is working to me. Thanks

# re: Error:in adding gridview record the error is object instance is not created

Left by ccc at 6/25/2012 9:18 PM
Gravatar
gve reply...

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

Left by Dharsana at 1/17/2014 9:24 PM
Gravatar
How to unique id to dynamic controls? Please someone help

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

Left by Dharsana at 1/17/2014 9:26 PM
Gravatar
How to create unique id to dynamic controls? Please someone help

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

Left by Blud at 2/20/2014 1:36 AM
Gravatar
Same question, how to create unique id to dynamic controls?
Thanks a lot !

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

Left by Blud at 2/20/2014 2:59 AM
Gravatar
The problem was that i had a column.DataField = "".

Your comment:



(not displayed)

 
 
 
 
 

Live Comment Preview:

 
«October»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678