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

Give a few examples of page life cycle events.

0 Answers   Accenture,


Define application state variable and session state variable?

0 Answers   UGC Corporation,


COM+ Used ________________ Isolation Level

0 Answers   CTS,


what is difference between .net 3.0 and 3.5

3 Answers  


What is distributed system in asp.net?

0 Answers  






what is generics?

2 Answers   Microsoft,


In a page there is dropdown list with the name of the cities like Bangalore,Pune,Chennai,Other and a text box that would enable the user to enter the name of the city if other is selected. How to enable validation on the text box if other is selected

8 Answers   Proteans,


What is Active Directory? What is the namespace for that?

2 Answers  


What do you mean by View State and what is its role?

0 Answers   Wipro,


Can any one explain with the example how to capture the application error in Aplication_Error() method?

1 Answers   Infosys,


Create the Output by mearging 2 tables and taking common column sid from both you should not use database create table and data in it Randomly table 1 sid sname saddress 1 sa ampt 2 na hyd 3 ha hyd table 2 sid dno dname 1 12 stats 2 23 phy 3 12 stats OutPUt sid sname saddress did dname 1 sa ampt 12 stats 2 na hyd 23 phy 3 ha hyd 12 stats

1 Answers  


Types of authentications in ASP.NET ?

9 Answers   Accenture, Roland, Shriram,


Categories