Executing a Method when i click the template column

Discussion in 'ASP .Net Datagrid Control' started by n.nsiva@gmail.com, Sep 14, 2006.

  1. Guest

    Hai All

    I have an problem and needs a solution, the problem is described
    below..

    I have place a datagrid with 3 bound columns and 1 template column
    where on that template column i pace a link button web server control
    on the item template. Now what i need is whenever i click that
    particular linkbutton of a column i want to execute a simple method.

    Hope all reply to me.
    Sivakumar.N
     
    , Sep 14, 2006
    #1
    1. Advertising

  2. Teemu Keiski Guest

    Hi,

    wire a handler method to the LinkButton in the ItemTemplate

    <asp:linkButton ID="..." OnClick="LinkButton_Click" />

    It would make the event handler method same for all LinkButtons but you can
    get the specific one by casting 'sender' argument to LinkButton. Another way
    would be just applying CommandName attribute to it and handling ItemCommand
    event (RowCommand in GridView)

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke

    <> wrote in message
    news:...
    > Hai All
    >
    > I have an problem and needs a solution, the problem is described
    > below..
    >
    > I have place a datagrid with 3 bound columns and 1 template column
    > where on that template column i pace a link button web server control
    > on the item template. Now what i need is whenever i click that
    > particular linkbutton of a column i want to execute a simple method.
    >
    > Hope all reply to me.
    > Sivakumar.N
    >
     
    Teemu Keiski, Sep 16, 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. Dexter
    Replies:
    1
    Views:
    439
    Eliyahu Goldin
    Jan 18, 2005
  2. Ken Varn
    Replies:
    1
    Views:
    992
    Ken Varn
    Aug 19, 2005
  3. Replies:
    4
    Views:
    490
  4. KJ
    Replies:
    3
    Views:
    424
  5. chandu
    Replies:
    1
    Views:
    205
    marss
    Oct 30, 2006
Loading...

Share This Page