Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6113871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:54:31+00:00 2026-05-23T14:54:31+00:00

I want to fire the Delete Command in Datalist Control .. but it is

  • 0

I want to fire the Delete Command in Datalist Control .. but it is not firing .. Help please ..

this is my code :

protected void DeleteCommand(object source, DataListCommandEventArgs e)
{
        Label2.Text = "hello";
}

and This is my html code :

   <asp:DataList ID="DLImages" runat="server" BorderStyle="None" 
         DataKeyField="fId" RepeatColumns="4" 
         RepeatDirection="Horizontal" ShowFooter="False" ShowHeader="False" 
         OnDeleteCommand="DeleteCommand" 
         onitemdatabound="DLImages_ItemDataBound">
             <ItemTemplate>
                   <asp:ImageButton ID="IBDelete" runat="server" BorderStyle="None" CommandName="Delete" ImageUrl="~/Dashboard/Images/dldelete.png" />
             </ItemTemplate>
    </asp:DataList>

..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:54:32+00:00Added an answer on May 23, 2026 at 2:54 pm

    Your code looks like OK to me. It should fire the DeleteCommand.

    But the problem is that I am sure you are binding the Datalist in your page_load event, but not under If(!IsPostBack) condition. What happens when you hit Delete button is your page_load event fires before your DeleteCommand and it rebinds the DataList and your event is lost

    Your page_load event code should look like…

    If(!IsPostBack) 
    {
      DataList binding code goes here......
      ...........................
    }
    
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        // Bind the DataList here....
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to let TextBox control TextChanged event fire only when there are more
I want to fire a recursive function every 10 milliseconds, but setTimeout doesn't seem
I want to fire some code when a property is accessed and changed. I
i have a asp:button that will fire a delete and want to have a
Acutallly I want to fire item editing events. But how do I find the
I want a similar behavior of confirm delete option in ASP.Net Gridview, as this
I want to fire a command line executible with the parameters entered in GUI.
In this case it wont fire the Http method Delete in firebug when i
I want to fire up a flash presentation inside Powerpoint 2007. I am calling
i want to fire an event manually using c#. For instance, say if i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.