how to call javascript function on button click and then from ajax pass value to aspx page method

Posted by Swappy_Gaj under ASP.NET AJAX on 12/25/2014 | Points: 10 | Views : 662 | Status : [Member] | Replies : 2
[Very Urgent]
[New to ajax]
how to call javascript function on button click and then from ajax pass value to aspx page method




Responses

Posted by: vishalneeraj-24503 on: 12/26/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi,
If you are using Asp.Net control then you can use OnClientClick event for javascript function,
and if you are using HTML controls,then use onclick event for javascript function.
For Example:-
<asp:Button ID="btn_submit" runat="server" Text="Submit" OnClientClick="return javascript_function();" />
<input type="button" value ="Submit" onclick ="javascript_function();" />

Replace javascript_function with your function.

Swappy_Gaj, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response