EXT.NET-按钮事件返回值处理

.aspx

 

<ext:Button ID="Button1" runat="server" Text="2*2=?" Icon="Lightning">

<Listeners>

<Click Handler="

        Ext.net.DirectMethods.GetTimeStamp(2,{

         success: function (result) {

          txtGet.setValue(result);

}

});" />

</Listeners>

</ext:Button>

<ext:TextField ID="txtGet" runat="server" FieldLabel="显示结果"></ext:TextField>

.cs代码:

 

[DirectMethod]

public string GetTimeStamp(int value)

{

     int result = value * value;

     return result.ToString();

}

你可能感兴趣的:(.net)