User Conformation On datagrid update command

Discussion in 'ASP .Net Datagrid Control' started by Santosh, Jun 9, 2006.

  1. Santosh

    Santosh Guest

    Dear all i want to call javascript function for asking user to conform
    about specific action

    i am writting following code but when i am click on update & cancel
    same function is called
    so please tell me solution behind them.
    i want to call java script function on only update button


    public void SetUpClientValidation(object sender, DataGridItemEventArgs
    e)
    {
    if(e.Item.ItemType == ListItemType.Edit)
    {
    e.Item.Cells[3].Attributes.Add("OnClick","JavaScript:return
    ConformUpdateInformation();");

    }

    function ConformUpdateInformation()
    {
    return confirm("Are you sure to Update records?");
    }


    Help will be apreciated
     
    Santosh, Jun 9, 2006
    #1
    1. Advertisements

  2. Santosh

    John Prado Guest

    Try

    e.Item.Cells[3].Controls(0).Attributes.Add(...

    You are putting your "onclick" event on table cell not in your LinkButton.


    Santosh wrote:
    > Dear all i want to call javascript function for asking user to conform
    > about specific action
    >
    > i am writting following code but when i am click on update & cancel
    > same function is called
    > so please tell me solution behind them.
    > i want to call java script function on only update button
    >
    >
    > public void SetUpClientValidation(object sender, DataGridItemEventArgs
    > e)
    > {
    > if(e.Item.ItemType == ListItemType.Edit)
    > {
    > e.Item.Cells[3].Attributes.Add("OnClick","JavaScript:return
    > ConformUpdateInformation();");
    >
    > }
    >
    > function ConformUpdateInformation()
    > {
    > return confirm("Are you sure to Update records?");
    > }
    >
    >
    > Help will be apreciated
    >
     
    John Prado, Jun 25, 2006
    #2
    1. Advertisements

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. San Diego Guy
    Replies:
    0
    Views:
    721
    San Diego Guy
    Aug 7, 2003
  2. vlad
    Replies:
    1
    Views:
    488
    Steve C. Orr, MCSD
    Aug 13, 2003
  3. =?Utf-8?B?YWJkb2x5?=

    datagrid update command

    =?Utf-8?B?YWJkb2x5?=, Jun 1, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    6,293
    sobin
    Mar 19, 2005
  4. John Blair

    Datagrid update command - and validators

    John Blair, Jan 24, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    3,433
    vgebrev
    Jan 30, 2008
  5. =?Utf-8?B?c2lhag==?=

    Datagrid update command

    =?Utf-8?B?c2lhag==?=, Feb 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,110
    Craig G
    Feb 28, 2005
  6. =?Utf-8?B?c2lhag==?=

    datagrid update Command

    =?Utf-8?B?c2lhag==?=, Mar 4, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    3,487
    =?Utf-8?B?c2lhag==?=
    Mar 7, 2005
  7. Andreas Klemt
    Replies:
    0
    Views:
    491
    Andreas Klemt
    Oct 8, 2003
  8. prakash
    Replies:
    2
    Views:
    806
    prakash
    Apr 11, 2005
Loading...