How do I get the Clicked Event on Hyperlink to execute a Command?

Discussion in 'ASP .Net Datagrid Control' started by Paul D. Fox, Jun 9, 2005.

  1. Paul D. Fox

    Paul D. Fox Guest

    I have a ButtonColumn as a link. When the user clicks on it, I want to execute a command to query a database and display data in another grid. I need to get the key and pass it to the query.

    Here's part of the DataGrid HTML:

    <asp:ButtonColumn Text="Select" DataTextField="Schedule" HeaderText="Training Dates" CommandName="Select"></asp:ButtonColumn>

    How do I call an Event, get the primary key ( I guess its the DataKeyField) and run another query?
     
    Paul D. Fox, Jun 9, 2005
    #1
    1. Advertising

  2. Paul D. Fox

    Paul D. Fox Guest

    Nevermind, I solved it. I used the ItemCommand Event to get
    datagrid1.DataKeys(e.Item.ItemIndex)

    "Paul D. Fox" <> wrote in message news:...
    I have a ButtonColumn as a link. When the user clicks on it, I want to execute a command to query a database and display data in another grid. I need to get the key and pass it to the query.

    Here's part of the DataGrid HTML:

    <asp:ButtonColumn Text="Select" DataTextField="Schedule" HeaderText="Training Dates" CommandName="Select"></asp:ButtonColumn>

    How do I call an Event, get the primary key ( I guess its the DataKeyField) and run another query?
     
    Paul D. Fox, Jun 9, 2005
    #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. Lucas Cowald
    Replies:
    4
    Views:
    1,139
    Tohid
    Oct 23, 2003
  2. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    285
    Genich
    Oct 22, 2003
  3. Ken
    Replies:
    1
    Views:
    429
    Alvin Bruney
    Aug 16, 2003
  4. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page.

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    242
    Oliver
    Oct 22, 2003
  5. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page.

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    208
    Lucas Cowald
    Oct 22, 2003
Loading...

Share This Page