This is a discussion on ListView server control in ASP.Net 3.5 within the Discussweb HQ forums, part of the The Lobby category; Display a warning message when the user clicks Delete in a ListView Control It will be always helpful to ask ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#11
| |||
| |||
| Display a warning message when the user clicks Delete in a ListView Control It will be always helpful to ask user before they actually delete the row from the ListView and eventually from the database. We could display a warning message whether they really intend to delete the row. If the reply is either yes or OK, then we could carry out with the actual removal of the rows from the database. This can be done using the following technique: During the ItemDataBound event, we can attach a client side event for each Delete Link in the ListView control. Code: protected void DataBoundList(Object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
LinkButton lnkDelete = (LinkButton)e.Item.FindControl("lnkDelete");
if (lnkDelete != null)
{
lnkDelete.Attributes.Add("onclick",
"return confirm('Are you sure you want to delete this author?');");
}
}
}
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQL Server 2000 migration to SQL Server 2005 Collation Change - Method? | arjkhanna | Database Support | 5 | 10-02-2009 09:58 PM |
| How to control the webcam using C#? | kingmaker | C# Programming | 9 | 09-05-2009 02:57 AM |
| Showing the Image file thumbnail view in ListView control using VC++ 6.0 | prabhat.singh | C and C++ Programming | 0 | 01-17-2008 09:53 PM |
| How do I get the value of a form control? | itbarota | HTML, CSS and Javascript Coding Techniques | 2 | 10-26-2007 03:13 AM |
| use of Custom Control and User Control? | a.deeban | ASP and ASP.NET Programming | 1 | 08-20-2007 07:25 AM |
Our Partners |