Image Button Not Working With DataGrid ItemCommand?

Discussion in 'ASP .Net' started by Adam Knight, Feb 6, 2006.

  1. Adam Knight

    Adam Knight Guest

    Hi all,

    I have a datagrid like so:

    <asp:datagrid id="dgContractors"
    OnItemCommand="dgContractor_ItemCommand"
    Runat="server"
    Width="920">

    Shortened for brevity..

    It contains a template collumn like so:

    <asp:TemplateColumn HeaderText="Superintendent">
    <ItemTemplate>
    <asp:LinkButton ID="test"
    CommandName="ShowSupervisorDetails"
    CommandArgument='<%#
    Container.DataItem("cntr_mgt_supervisor_id")%>'
    Runat="server">Test </asp:LinkButton>

    <asp:ImageButton
    ImageUrl="images/icons/info.gif"
    CommandArgument='<%#
    Container.DataItem("cntr_mgt_supervisor_id")%>'
    CommandName="ShowSupervisorDetails"
    ID="ibtnSuperintendentInfo"
    Runat="server"/>
    </ItemTemplate>
    <FooterTemplate></FooterTemplate>
    </asp:TemplateColumn>

    The LinkButton successfully fires the ItemCommand Event.

    The ImageButton doesn't???

    Any ideas?

    Cheers,
    Adam
    Adam Knight, Feb 6, 2006
    #1
    1. Advertising

  2. Hi adam

    I met the same problem:
    follow that post where I was submitting that issue

    http://msdn.microsoft.com/newsgroup...-DC48AB0DA5C9&dglist=&ptlist=&exp=&sloc=en-us

    regards
    serge
    "Adam Knight" wrote:

    > Hi all,
    >
    > I have a datagrid like so:
    >
    > <asp:datagrid id="dgContractors"
    > OnItemCommand="dgContractor_ItemCommand"
    > Runat="server"
    > Width="920">
    >
    > Shortened for brevity..
    >
    > It contains a template collumn like so:
    >
    > <asp:TemplateColumn HeaderText="Superintendent">
    > <ItemTemplate>
    > <asp:LinkButton ID="test"
    > CommandName="ShowSupervisorDetails"
    > CommandArgument='<%#
    > Container.DataItem("cntr_mgt_supervisor_id")%>'
    > Runat="server">Test </asp:LinkButton>
    >
    > <asp:ImageButton
    > ImageUrl="images/icons/info.gif"
    > CommandArgument='<%#
    > Container.DataItem("cntr_mgt_supervisor_id")%>'
    > CommandName="ShowSupervisorDetails"
    > ID="ibtnSuperintendentInfo"
    > Runat="server"/>
    > </ItemTemplate>
    > <FooterTemplate></FooterTemplate>
    > </asp:TemplateColumn>
    >
    > The LinkButton successfully fires the ItemCommand Event.
    >
    > The ImageButton doesn't???
    >
    > Any ideas?
    >
    > Cheers,
    > Adam
    >
    >
    >
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Feb 6, 2006
    #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. Marina
    Replies:
    3
    Views:
    2,778
    Chad Crowder
    Feb 29, 2004
  2. Utter Newbie
    Replies:
    3
    Views:
    3,735
    Utter Newbie
    Oct 5, 2004
  3. =?Utf-8?B?ZGFuYw==?=

    DataGrid ItemCommand event not firing if not first page

    =?Utf-8?B?ZGFuYw==?=, Oct 26, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    4,149
    =?Utf-8?B?ZGFuYw==?=
    Oct 26, 2005
  4. pietaster

    ItemCommand not working when datagrid can page and sort

    pietaster, Apr 7, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    13
    Views:
    277
    pietaster
    Apr 15, 2004
  5. RCorona
    Replies:
    1
    Views:
    160
    Al Cadalzo
    Jan 1, 2005
Loading...

Share This Page