Jul 08, 2009, 1:19 PM
[CLOSED] Pass object to AjaxMethod
How can I pass a dictionary(of string, string) to an AjaxMethod? Or a complex object? What are the possible types for parameters an AjaxMethod can accept?
Sample code:
Sample code:
<form id="form1" runat="server">
<script runat="server">
<AjaxMethod(Type:=AjaxEventType.Load)> _
Public Shared Function Test(ByVal aParams As Dictionary(Of String, String)) As String
Return aParams.Item("param1")
End Function
</script>
<script type="text/javascript">
function test() {
Coolite.AjaxMethods.Test({
param1: 'success',
param2: 'success'
}, {
success: function(result) {
Ext.Msg.alert('Status', result);
}
}
);
}
</script>
<ext:ScriptManager ID="ScriptManager2" runat="server" IDMode="Static">
</ext:ScriptManager>
<ext:Button runat="server" ID="btnTest" Handler="test" Text="Test">
</ext:Button>
</form>