How to call JS function through Button control dynamically?

 Posted by vishalneeraj-24503 on 6/6/2014 | Category: ASP.NET Interview questions | Views: 353 | Points: 40
Answer:

By writing following code,we can call JS function through Button control or Linkbutton,ImageButton etc..
Syntax:-
Button1.Attributes.Add("onclick", "return JSFunction();");

For Example:-
Button1.Attributes.Add("onclick", "return setborder();");


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response