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 are the difference between function and stored procedure in .net programming language?

1 Answers  


What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

1 Answers  


Which tool you have done?

1 Answers  


What is DTS package?

2 Answers   Accenture, TCS,


Is data can be edited in the Repeater control?

2 Answers  


What is the use of service provider?

1 Answers  


What is the other method, other than GET and POST, in ASP.NET?

3 Answers  


How many types of server controls do we have?Also explain differance between them taking an example of ASP.NET?

1 Answers  


In C#.net application is run on linux michine

4 Answers  


How to write unmanaged code and how to identify whether the code is managed / unmanaged ?

2 Answers   Accenture, BirlaSoft, Cogtest,


i have one gridview contains edititemtemplate(which contains update and cancel buttons) and i have one item template (contains edit button) i want the code for update and cancelbuttons in edit item template and i want the code for edit button in itemtemplate. please help me

4 Answers  


Explain the scenario where we go for inpro and outpro session?

3 Answers  


Categories