Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
How to add alert Javascript coding for Gridview?
Author:
C.DHAKCHINA MOORTHY
E-mail:
Click to e-mail author
Website:
http://shss.co.in
Submitted:
2/7/2007
Version:
ASP.NET 2.0
Compatibility:
ASP.NET 2.0
Category:
ASP.NET
Views:
34064
Sometimes we need to confirm from the client side, whether to proceed for deletion operation or not? We can use this code snippet to add that alert box to the user.
Declarations:
'none
Code:
Protected Sub gvcat_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvcat.RowDataBound ' This block of code is used to confirm the deletion of current record. If e.Row.RowType = DataControlRowType.DataRow Then Dim l As Object ' e.Row.Controls(4) is Delete button. l = e.Row.Controls(4) l.Attributes.Add("onclick", "javascript:return confirm('Are you sure to delete?')") End If End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement