Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
This should be simple, but I don't see it
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
This should be simple, but I don't see it
Versions des environnements
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01307914
Message ID:
01307914
Vues:
59
Hi everybody,

Here is a code:
protected void grdDeleteUsers_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.DataItem != null)
        {
            ImageButton btnDelete = (ImageButton) e.Row.Cells[0].Controls[0];  

            //((ImageButton)item.Cells[0].Controls[0]).Attributes.Add("onClick", "return confirm('Are you sure you want to delete this ?')");

            //LinkButton link = e.Row.FindControl("lnkbtnRemoveRole") as LinkButton;

            if (btnDelete != null)
            {

               e.Row.ToolTip = "Delete " +  e.Row.DataItem.ToString()  ;

                //btnDelete.Attributes["onclick"] =
                //    "return confirm('Do you want to delete " +
                //    e.Row.DataItem.ToString() + "?' );";
               // btnDelete.CommandArgument = "RemUser";
            }
         }
     }
If I uncomment btnDelete part I get JavaScript confirm dialog, but regardless on the answer in doesn't delete.

Without the dialog it deletes great.

Do you see what's wrong here?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform