This blog is about the dotnet.all types of codes,news about dotnet including asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.ncluding asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.asp.net programming,dot net programming,dotnet programs,dotnet source code,source code.

Free Hosting

Free Hosting

Sunday, November 2, 2008

ASP.NET CODE to Adding a Confirmation message box

Adding a Confirmation message box to a delete command button in a Datagrid column before deleting from a table in a database

CODE:

Private Sub dgView_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgView.ItemDataBound
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem
Dim deleteButton As LinkButton = CType(e.Item.Cells(6).Controls(0), LinkButton)
deleteButton.Attributes.Add("onclick", "javascript:return confirm('Are you sure you want to delete this ?');")
End Select
End Sub



Private Sub dgView_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgView.DeleteCommand
If e.CommandName = "Delete" Then
'delete from database commands
BindData()
End If
End Sub

0 comments:

dotnet(.Net) Project Source code Downloads and Tutorials

Email Subscrption



Enter your email address:

Delivered by FeedBurner

Feedburner Count

Blog Archive

Unique Visitor

Design by araba-cı | MoneyGenerator Blogger Template by GosuBlogger