Bug in System.Web.UI.WebControls.DataKey - by George Hartz (LP)

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 775825 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/4/2013 11:01:00 AM
Access Restriction Public


Simple bug -- System.Web.UI.WebControls.DataKey in System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a doesn't have Equals() implemented properly.

There's a Equals(DataKey) method, which does a correct equality check, but the Equals(object) isn't overridden, which results in a pure reference check depending on which Equals call is called at compile-time. 

So if you have two DataKey objects, k1 and k2, where k2 is a clone of k1, k1.Equals(k2) will return true. However, if you put k1 into an untyped collection (for example, like an ArrayList), arrayList.Contains(k2) will return false because ArrayList is calling Equals(object)
Sign in to post a comment.
Posted by Microsoft on 7/10/2014 at 6:02 PM
Thanks for reporting this issue!

We have confirmed that this is a bug in ASP.NET and have copied the provided information to our internal bug database for consideration in a future release. In the meantime, if you are blocked because of this issue and need a fix or a workaround more quickly, we suggest you contact Customer Support Solutions (http://support.microsoft.com/oas/default.aspx?Gprid=548&st=1&wfxredirect=1&sd=gn) and reference this Connect bug.

Thank you again for your submission!
Posted by Microsoft on 2/18/2013 at 12:25 PM
Thank you for your report. We're tracking this issue internally for an appropriate future release.
Posted by Microsoft on 1/7/2013 at 12:32 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 1/4/2013 at 11:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)