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 are the modes of updation in an updatepanel?

553


What are demand-paging and pre-paging?

572


What are the ways to sending the data in ASP.NET page?

563


Which validator control you use if you need to make sure the values in two different controls matched?

645


When using the Pager object, inorder to know which page to go, which property you have to set to grid?

561






Describe in brief .net framework and its components.

540


Write code to send e-mail from an asp.net application?

544


What is a runtime version?

526


If you are using two select queries and retrieving data. how do you access second query's result set using data reader?

4742


What is Partial PostBack in ASP.NET?

598


How does windows service lifecycle differ from a .standard. Exe?

510


Using code explain Configuration Management

1406


what is publisher?

1648


What are custom user controls in asp.net?

512


What is special types forms

535