I need to call a method in Javascript and a method in C# when a button is clicked.
First, I want to call the C# method called 'Find_Direction'
on click, which takes two inputs. Then, I want to call the Javascript method named calcRoute
.
I attempted to do this, but it was unsuccessful:
<asp:Button id="Button1" UseSubmitBehavior="False" value="GetDirections" onclick="calcRoute" OnClientClick="Find_Direction" runat="server"/>
The following error occurred:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'ASP.findroute_aspx' does not contain a definition for 'calcRoute' and no extension method 'calcRoute' accepting a first argument of type 'ASP.findroute_aspx' could be found (are you missing a using directive or an assembly reference?)