Attributes add for controls in gridview in asp.net with c#

Unknown | 4:05 AM |

 protected void dglistinner_ItemDataBound(object sender, DataGridItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem | e.Item.ItemType == ListItemType.Item)
            {
              ImageButton lnk = new ImageButton();
                lnk = (ImageButton)e.Item.FindControl("img");
               lnk.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this Data?');");
            }
        }
        catch (Exception ex)
        {
        }
    }

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....