"ambiguous match found" error

Discussion in 'ASP .Net Web Controls' started by Anthony Ruggeri, Jan 30, 2004.

  1. 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.
     
    Anthony Ruggeri, Jan 30, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
     
    Anthony Ruggeri, Jan 30, 2004
    #2
    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. Denon
    Replies:
    2
    Views:
    4,375
    Yuke Liew
    Jan 2, 2004
  2. =?Utf-8?B?QWxleGFuZHJl?=

    Error: Ambiguous match found.

    =?Utf-8?B?QWxleGFuZHJl?=, Apr 23, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    16,588
    OnPreInit
    Oct 1, 2009
  3. Francois
    Replies:
    3
    Views:
    661
    Hans Kesting
    May 22, 2007
  4. Craig Jewiss via .NET 247

    "Error Creating Control" - "Ambiguous match found"

    Craig Jewiss via .NET 247, Apr 26, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    234
    Craig Jewiss via .NET 247
    Apr 26, 2004
  5. Victor Irzak

    Please HELP!!! parser error: ambiguous match found.

    Victor Irzak, Apr 19, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    139
    Victor Irzak
    Apr 19, 2004
Loading...

Share This Page