Writing onclick event for button

S

Sandeep

Hi

I want to write onclick event on a button(a web control) ,also i want to
call a client side function on the click event
how to write that how to differentiate between these two events

Will it be like that
<asp:button id="ss" onclick="javascript:ss()" onserverclick="btn_click()">



Regards

Sandeep
 
T

Teemu Keiski

You'd do it in code (because normal ASP.NET Button the event handler is
named as OnClick for server.side click event handler.

Example:
Button1.Attributes("onclick") = "alert('This is raised before postback')"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top