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

Explain the concept of event bubbling in ASP.NET?

0 Answers   Sans Pareil IT Services,


detail code for sql data connections?

2 Answers  


What are the differences between Dataset and DataReader?

3 Answers   Accenture,


What are the three parts of an http response?

0 Answers  


Which is better php or asp.net?

0 Answers  






What do you mean by authorization?

0 Answers  


What is state management in .net?

0 Answers  


Can we use multiple web.config files in an sigle appliction?

3 Answers   IBS,


About Global .asax ?

6 Answers   Satyam,


14. What are your Future Plans for Swatz Oils GROUP U.K?

0 Answers   CSC, Swatz Oils, TCS,


If I update session state, should I lock it, too? Are concurrent accesses by multiple requests executing on multiple threads a concern with session state?

1 Answers  


What is Response.Flush method ?

3 Answers   Keane India Ltd,


Categories