Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > "ambiguous match found" error

Reply
Thread Tools

"ambiguous match found" error

 
 
Anthony Ruggeri
Guest
Posts: n/a
 
      01-30-2004
I've heard a little bit about the "ambiguous match found" problem with
VB.Net custom controls. We suddenly started getting this error yesterday.
We are running ASP.NET 1.1 and using Visual Studio 2003.

Has anyone else seen this error and (better yet) a solution? I heard that
it was fixed in 1.1 but it obviously is not.


 
Reply With Quote
 
 
 
 
Anthony Ruggeri
Guest
Posts: n/a
 
      01-30-2004
Unfortunately changing the name of the property is not really an option,
since the idea is that derived classes will expose the same interface as is
found in the base class.

Plus we are using VB.NET, not C#.

"Christian Falch" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> Anthony Ruggeri wrote:
> > I've heard a little bit about the "ambiguous match found" problem with
> > VB.Net custom controls. We suddenly started getting this error

yesterday.
> > We are running ASP.NET 1.1 and using Visual Studio 2003.
> >
> > Has anyone else seen this error and (better yet) a solution? I heard

that
> > it was fixed in 1.1 but it obviously is not.

>
> I saw it yesterday, and fixed it yesterday as well.
>
> The reason behind why I experienced the error message can be described
> with the following scenario:
>
> I've got two classes; MyBaseClass and MyDerivedBaseClass. Both has a
> property called ParentBaseControl which is returns an instance of
> MyBaseClass in MyBaseClass controls, and is overridden by the keyword
> "new" in the class MyDerivedBaseClass:
>
> public class MyBaseClass
> {
> public MyBaseClass ParentBaseControl...
> }
>
> public class MyDerivedBaseClass: MyBaseClass
> {
> public new MyDervivedBaseClass ParentBaseControl...
> }
>
> When using reflection to set the property ParentBaseControl, I get the
> error message you described, since reflection can't decide which of the
> two properties to use (which is correct, since both are accessible in
> the derived class: the parent class' property can be set with
> base.ParentBaseControl = value).
>
> The solution was simply to give the property a different name in the
> derived class.
>
> Hope this helps!
>
> --
> Chris



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
re.sub(): replace longest match instead of leftmost match? John Gordon Python 13 12-20-2011 02:58 AM
pat-match.lisp or extend-match.lisp in Python? ekzept Python 0 08-10-2007 06:08 PM
Match doesn't match Volkan Civelek Ruby 4 07-19-2006 07:44 AM
$match = true() for empty $match?? Victor XML 2 05-17-2004 10:43 AM
Java regex can't match lengthy match? hiwa Java 0 01-29-2004 10:09 AM



Advertisments