How do you add a javascript function for a link button in a
datagrid?

Answer Posted / ish

Make object of particular button

Ex:

LinkButton lnbDelete=(LinkButton) e.Item.FindControl
("Delete");

After that we can use it with JavaScript:
lnbDelete.Attributes.Add("Onclick","javascript:return
confirm('Are you sure you want to delete this?');");

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a reflection?

588


What are the differences between clr & cts?

543


Do you support digital rights management to protect my videos?

457


What is postback in asp net?

564


What is custom attribute? How to create?

545






Differentiate between file-based dependency and key-based dependency.

513


What is a runtime version?

533


How can we register exception filter from the action?

668


What are the media types of http requests and response?

512


What is the file through which you can customize your asp.net application?

550


Describe briefly what is the role of IIS on an ASP.NET application? What does it for the same application?

565


i want to implement grid view value in paypal site. so how to create this code in asp.net with C#

1414


What is the server of asp.net?

514


What is runat?

617


What is variable and constant in .net programming language?

397