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

Answer Posted / vidit tyagi

you can add a javascript function in the link button of the
datagrid under the itemdatabound event as below


linkbutton linkbtn=(linkbutton)( e.item.findcontrol
("linkbtnname"))
linkbtn.attribute.add("onclick",javascript:returnfuctionname
()");

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference cookie and session?

737


What is a runtime version?

721


How to implement role based security in asp.net mvc? : Asp.Net MVC

636


How is session id generated?

655


Why will you usually create an aspnet user account in the database for an asp.net web application?

748


Can we add code files of different languages in app_code folder?

834


How do you create a master page?

775


What is Web Server Control Templates.?

788


What is the difference between session and viewstate in asp.net?

859


Mention the namespace that is used to include .net data provider for sql server in .net code?

710


Explain diff. Between friend and protected friend?

691


How to unit test Web API?

928


What is asp.net globalization?

694


How do we assign page-specific attributes?

830


What are client activated objects and server activated objects?

719