DataList Events Not Firing!!!

Discussion in 'ASP .Net Web Controls' started by Rush, Feb 13, 2004.

  1. Rush

    Rush Guest

    Can anyone tell me why events in my EditItemTemplate are not firing?
    I'm not getting UpdateCommand, CancelCommand, DeleteCommand. I see
    posts going back to 2001 concerning this. Has this been fixed? I'm
    running Dev Studio v7, .NET Framework v1.0. ASP.NET w/ C# CodeBehind.

    The events from the ItemTemplate run fine. The EditItemTemplate
    ListButtons are wired up exactly the same way. The OnInit() is firing
    as is the InitializeComponent()

    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
    this.DataList1.ItemCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_ItemCommand);
    this.DataList1.CancelCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_CancelCommand);
    this.DataList1.EditCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_EditCommand);
    this.DataList1.UpdateCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_UpdateCommand);
    this.DataList1.DeleteCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_DeleteCommand);
    this.DataList1.SelectedIndexChanged += new
    System.EventHandler(this.DataList1_SelectedIndexChanged);
    this.Load += new System.EventHandler(this.Page_Load);

    }
     
    Rush, Feb 13, 2004
    #1
    1. Advertising

  2. Rush

    Teemu Keiski Guest

    What is happening in the Page_Load? You aren't accidentally rebinding the
    grid on postback? Post some more code to demonstrate.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Rush" <> wrote in message
    news:...
    Can anyone tell me why events in my EditItemTemplate are not firing?
    I'm not getting UpdateCommand, CancelCommand, DeleteCommand. I see
    posts going back to 2001 concerning this. Has this been fixed? I'm
    running Dev Studio v7, .NET Framework v1.0. ASP.NET w/ C# CodeBehind.

    The events from the ItemTemplate run fine. The EditItemTemplate
    ListButtons are wired up exactly the same way. The OnInit() is firing
    as is the InitializeComponent()

    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
    this.DataList1.ItemCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_ItemCommand);
    this.DataList1.CancelCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_CancelCommand);
    this.DataList1.EditCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_EditCommand);
    this.DataList1.UpdateCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_UpdateCommand);
    this.DataList1.DeleteCommand += new
    System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_DeleteCommand);
    this.DataList1.SelectedIndexChanged += new
    System.EventHandler(this.DataList1_SelectedIndexChanged);
    this.Load += new System.EventHandler(this.Page_Load);

    }
     
    Teemu Keiski, Feb 13, 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. Wee Bubba
    Replies:
    0
    Views:
    540
    Wee Bubba
    May 24, 2004
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,917
  3. =?Utf-8?B?SmltIEhlYXZleQ==?=

    DataList - Events Not Firing

    =?Utf-8?B?SmltIEhlYXZleQ==?=, Aug 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,756
    Teemu Keiski
    Aug 16, 2005
  4. SevDer
    Replies:
    2
    Views:
    1,313
    Walter Wang [MSFT]
    Nov 13, 2007
  5. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    388
    Chris
    Aug 30, 2005
Loading...

Share This Page