Reputation: 61
I would like to know if is possible to use a asp:button
, use an event click. and call a javascript instead code behind without to do postback?
I need to record voice and I´m using javascript to do this.
Someone could help me?
Upvotes: 1
Views: 994
Reputation: 2738
You could create your button and use the OnClientClick Property in this way:
<asp:Button runat="server" Text="Click me" OnClientClick="myFunction(); return false;" />
With that you call myFunction();
and the return false;
prevent the __doPostBack
function will be called avoiding the postback.
Upvotes: 1