No overload error???

Discussion in 'ASP .Net Web Controls' started by Gary Wardell, Jun 9, 2008.

  1. Gary Wardell

    Gary Wardell Guest

    HI,

    I'm getting this error:

    No overload for 'DoItemUpdated' matches delegate
    'System.Web.UI.WebControls.DetailsViewUpdatedEventHandler'

    on line=22

    Line 22 reads:

    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="false"
    style="top: 25px; left: 15px; position: absolute; width: 622px"
    DataSourceID="SqlDataSource3"
    AutoGenerateEditButton="true"
    AutoGenerateDeleteButton="true"
    AutoGenerateInsertButton="true"
    OnItemUpdated="DoItemUpdated"
    >


    The function in the code behind reads:

    protected virtual void DoItemUpdated(DetailsViewUpdatedEventArgs Args)
    {
    lblMsg.Text = " Record " + Args.Keys["BookID"] + " updated";
    }

    Since I am a bit new to ASP.net and C# I'm at a loss as to what it's trying
    to tell me?

    Is it saying it can't find the function?

    Is it saying that the definition of the function doesn't match what is
    expected?

    I've tried different definitions, the message doesn't change.

    It can find the Page_Load function in the same file which has a similar
    definition.

    Gary
    Gary Wardell, Jun 9, 2008
    #1
    1. Advertising

  2. You're missing a parameter in the event. Most events also take a parameter
    called sender, which is basically just a generic object that represents the
    object firing the event.


    Try doing this:
    protected void DoItemUpdated(object sender, DetailsViewUpdatedEventArgs
    Args)
    {

    }

    hope this helps,
    Mark Fitzpatrick
    Microsoft MVP- Expression

    "Gary Wardell" <> wrote in message
    news:...
    > HI,
    >
    > I'm getting this error:
    >
    > No overload for 'DoItemUpdated' matches delegate
    > 'System.Web.UI.WebControls.DetailsViewUpdatedEventHandler'
    >
    > on line=22
    >
    > Line 22 reads:
    >
    > <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="false"
    > style="top: 25px; left: 15px; position: absolute; width: 622px"
    > DataSourceID="SqlDataSource3"
    > AutoGenerateEditButton="true"
    > AutoGenerateDeleteButton="true"
    > AutoGenerateInsertButton="true"
    > OnItemUpdated="DoItemUpdated"
    >>

    >
    > The function in the code behind reads:
    >
    > protected virtual void DoItemUpdated(DetailsViewUpdatedEventArgs Args)
    > {
    > lblMsg.Text = " Record " + Args.Keys["BookID"] + " updated";
    > }
    >
    > Since I am a bit new to ASP.net and C# I'm at a loss as to what it's
    > trying
    > to tell me?
    >
    > Is it saying it can't find the function?
    >
    > Is it saying that the definition of the function doesn't match what is
    > expected?
    >
    > I've tried different definitions, the message doesn't change.
    >
    > It can find the Page_Load function in the same file which has a similar
    > definition.
    >
    > Gary
    >
    >
    >
    >
    Mark Fitzpatrick, Jun 10, 2008
    #2
    1. Advertising

  3. Gary Wardell

    Gary Wardell Guest

    Hi,

    That did it.
    Gary Wardell, Jun 12, 2008
    #3
    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. Eph0nk

    Error: Overload resolution failed

    Eph0nk, Oct 23, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,856
    Eph0nk
    Oct 23, 2003
  2. John Harrison
    Replies:
    1
    Views:
    1,915
  3. Piotre Ugrumov
    Replies:
    1
    Views:
    376
    Karl Heinz Buchegger
    Jan 22, 2004
  4. Piotre Ugrumov
    Replies:
    3
    Views:
    368
    Nick Hounsome
    Jan 25, 2004
  5. Ying-Chieh Liao

    function overload (not operator overload)

    Ying-Chieh Liao, Oct 11, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    248
    Sherm Pendley
    Oct 11, 2004
Loading...

Share This Page