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. Advertising

  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. 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. vlad
    Replies:
    1
    Views:
    421
    Steve C. Orr, MCSD
    Aug 13, 2003
  2. =?Utf-8?B?YWJkb2x5?=

    datagrid update command

    =?Utf-8?B?YWJkb2x5?=, Jun 1, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    6,087
    sobin
    Mar 19, 2005
  3. =?Utf-8?B?TWljaGFlbA==?=

    How to update datagrid after update

    =?Utf-8?B?TWljaGFlbA==?=, Mar 17, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    525
    Alex D.
    Mar 17, 2006
  4. Andreas Klemt
    Replies:
    0
    Views:
    339
    Andreas Klemt
    Oct 8, 2003
  5. prakash
    Replies:
    2
    Views:
    633
    prakash
    Apr 11, 2005
Loading...

Share This Page