Imagebutton as commandbutton

Discussion in 'ASP .Net Datagrid Control' started by RH, Nov 14, 2003.

  1. RH

    RH Guest

    Hi,
    I want to use an imagebutton as commandbutton in a datagrid. When I
    add a column, say "delete", convert it to a template column and
    replace the linkbutton with an imagebutton, the button will not work.
    What am I doing wrong?

    TIA
    Remco
     
    RH, Nov 14, 2003
    #1
    1. Advertising

  2. RH

    Teemu Keiski Guest

    And you specify the name of the action into CommandName property of the
    ImageButton, for example Delete so that DeleteCommand will be called for the
    grid? Valid names for these commands are specified in

    CancelCommandName
    DeleteCommandName
    EditCommandName
    NextPageCommandArgument
    PageCommandName
    PrevPageCommandArgument
    SelectCommandName
    SortCommandName .
    UpdateCommandName

    properties of Datagrid. By default they are "Update", "Delete","Sort" and so
    on. These DataGrid uses to detect which command it is in question and again
    should it raise specific event to cause some action or just raise
    ItemCommand event (which is raised in any case).

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


    <RH> wrote in message news:...
    > Hi,
    > I want to use an imagebutton as commandbutton in a datagrid. When I
    > add a column, say "delete", convert it to a template column and
    > replace the linkbutton with an imagebutton, the button will not work.
    > What am I doing wrong?
    >
    > TIA
    > Remco
     
    Teemu Keiski, Nov 17, 2003
    #2
    1. Advertising

  3. RH

    RH Guest

    Thanks for your reply!
    Yes, I do specify the commandname as Delete. However, the thing
    doesn't work. When I use the standard hyperlinkbutton, you can see in
    the statusbar a link to javascript when you hover the button. This
    does not happen when I hover the image button. It DOES generate a
    postback, but it seems to generate no event.

    On Mon, 17 Nov 2003 12:57:45 +0200, "Teemu Keiski"
    <> wrote:

    >And you specify the name of the action into CommandName property of the
    >ImageButton, for example Delete so that DeleteCommand will be called for the
    >grid? Valid names for these commands are specified in
    >
    >CancelCommandName
    >DeleteCommandName
    >EditCommandName
    >NextPageCommandArgument
    >PageCommandName
    >PrevPageCommandArgument
    >SelectCommandName
    >SortCommandName .
    >UpdateCommandName
    >
    >properties of Datagrid. By default they are "Update", "Delete","Sort" and so
    >on. These DataGrid uses to detect which command it is in question and again
    >should it raise specific event to cause some action or just raise
    >ItemCommand event (which is raised in any case).
     
    RH, Nov 17, 2003
    #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. Marcelo

    Prevent Postback with ImageButton

    Marcelo, Jul 1, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    939
    Kairi Zikpin
    Jul 1, 2003
  2. ganesh kolappan

    image/imagebutton client validation

    ganesh kolappan, Jul 3, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    497
    David Waz...
    Jul 3, 2003
  3. Replies:
    1
    Views:
    8,541
  4. Janaka Perera
    Replies:
    0
    Views:
    1,172
    Janaka Perera
    Oct 29, 2007
  5. Ben

    how to make commandbutton invisible?

    Ben, Aug 20, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    213
Loading...

Share This Page