Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This should be simple, but I don't see it
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
This should be simple, but I don't see it
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01307914
Message ID:
01307914
Views:
60
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
Next
Reply
Map
View

Click here to load this message in the networking platform