How to create a Delete button in a GridView which calls a Javascript function?

Discussion in 'ASP .Net' started by Miguel Dias Moura, Apr 5, 2006.

  1. Hello,

    In an Asp.Net 2.0 GridView I have ButtonField for deleting the record.
    I used .CommandName = "Delete".

    I want to cancel this server side action.
    I want, instead, the button to call a javascript function on the client
    side.
    And I need to send to that javascript function the RowIndex.

    How can I do this?

    Thanks,
    Miguel
     
    Miguel Dias Moura, Apr 5, 2006
    #1
    1. Advertising

  2. RE: How to create a Delete button in a GridView which calls a Javascri

    http://www.mycodekb.com/CodeDetails.asp?CodeID=437
    --
    Paul Zanbaka
    Sharepoint Adminstrator and DBA
    www.mycodekb.com


    "Miguel Dias Moura" wrote:

    > Hello,
    >
    > In an Asp.Net 2.0 GridView I have ButtonField for deleting the record.
    > I used .CommandName = "Delete".
    >
    > I want to cancel this server side action.
    > I want, instead, the button to call a javascript function on the client
    > side.
    > And I need to send to that javascript function the RowIndex.
    >
    > How can I do this?
    >
    > Thanks,
    > Miguel
    >
    >
     
    =?Utf-8?B?UGF1bCBaYW5iYWth?=, Apr 5, 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. TS
    Replies:
    5
    Views:
    14,547
    Jeffrey Tan[MSFT]
    Nov 29, 2005
  2. Replies:
    2
    Views:
    944
    Bengt Richter
    Aug 1, 2005
  3. chandan
    Replies:
    1
    Views:
    302
    bruce barker
    Feb 4, 2008
  4. chandan
    Replies:
    1
    Views:
    150
    PJ on Development
    Feb 8, 2008
  5. Bob
    Replies:
    5
    Views:
    272
Loading...

Share This Page