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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / krishna prasad

in databound event
foreach(dataview/datagrid items)
{
find the linkbutton(objLinkButton) row.findcontrl
("LinkButtonID")
objLinkButton.attributes.add("onClick","return "validates
();")
}

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

What data types do the RangeValidator control support?

2 Answers   Siebel Systems,


Describe the difference between inline and code behind - which is best in a loosely coupled solution Tightly coupled - INLINE

2 Answers  


repeater and gridview diff? Why is repeater fast than gridview?

3 Answers   TCS,


What are the types of authentications in ASP.NET?

2 Answers   Accenture, BirlaSoft,


What is the use of SmartNavigation property?

4 Answers  






What does uri mean?

0 Answers  


What is a session in programming?

0 Answers  


What does the .webpart file do?

0 Answers  


Given an ASP.NET Web Form called WebFrom1, what class does the WebForm1 class inherit from by default? a) System.Web.Form b) System.Web.GUI.Page c) System.Web.UI.Page d) System.Web.UI.Form

3 Answers   Syntax Softtech,


In your ASP.NET 2.0 web application you want to display an image that is selected from a collection of images. What approach will you use to implementing this?

0 Answers   HCL,


hi im shailendra singh my question is how we deploye the data base

3 Answers   HCL,


What are the various types of validation controls provided by asp.net?

0 Answers  


Categories