I found this AJAX .NET framework the other day, and so far I am enjoying working with it. However, one thing I can't figure out (the documentation is rather poor atm) is how to pass variables through the AJAX script. This is what I have so far:
//default2.aspx.vb
<AjaxPro.AjaxMethod()> _
Public Shared Function testSomething(ByVal value As String) As String
Return value
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AjaxPro.Utility.RegisterTypeForAjax(GetType(Default2))
End Sub
//default2.aspx
<a href="#" onclick="doTest(1);">test something</a>
<div id="temp" style="margin:15px 15px 0px 5px; padding:10px;"></div>
<script type="text/javascript">
function doTest(x){
Default2.testSomething(doTest_callback,x)
}
function doTest_callback(res,x){
alert(res.value);
document.getElementById("temp").innerHTML = ">>>> " + x + " <<<<"
}
</script>
I have a couple of other test functions that work fine, and they do comparatively more complex operations. Anyone have any insight into how to pass variables with AjaxPro? Alternative methods are welcome as well!