我有一个 javascript 方法和一个 c# 方法,现在单击一个按钮,我想同时调用它们。
首先,我想调用名为 as 的 c# 方法,'Find_Direction'
因为它可以输入 onclick,然后我将在名为 as 的 javascript 方法之后调用calcRoute
。
我正在尝试这个,但没有任何运气:
<asp:Button id="Button1" UseSubmitBehavior="False" value="GetDirections" onclick="calcRoute" OnClientClick="Find_Direction" runat="server"/>
弹出以下错误:
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?)